本文介紹了用 pandas 讀取 SAS 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在嘗試使用 pandas read_sas()
函數.
I'm trying to use the pandas read_sas()
function.
首先,我通過在 SAS 中運行此代碼來創建一個 SAS 數據集:
First, I create a SAS dataset by running this code in SAS:
libname tmp 'c: emp';
data tmp.test;
do i=1 to 100;
x=rannor(0);
output;
end;
run;
現在,在 IPython 中,我這樣做:
Now, in IPython, I do this:
import numpy as np
import pandas as pd
%cd C: emp
pd.read_sas('test.sas7bdat')
非常簡單,似乎應該可以工作.但我只是得到這個錯誤:
Pretty straightforward and seems like it should work. But I just get this error:
TypeError: read() takes at most 1 argument (2 given)
我在這里缺少什么?我正在使用熊貓版本 0.18.0
.
What am I missing here? I'm using pandas version 0.18.0
.
推薦答案
根據下面鏈接的問題報告,此錯誤將在 18.1 中修復.
According issue report linked below, this bug will be fixed in 18.1.
https://github.com/pydata/pandas/issues/12647
這篇關于用 pandas 讀取 SAS 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!