本文介紹了用 pandas 讀取 SAS 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我正在嘗試使用 pandas read_sas()
函數(shù).
I'm trying to use the pandas read_sas()
function.
首先,我通過在 SAS 中運行此代碼來創(chuàng)建一個 SAS 數(shù)據(jù)集:
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;
現(xiàn)在,在 IPython 中,我這樣做:
Now, in IPython, I do this:
import numpy as np
import pandas as pd
%cd C: emp
pd.read_sas('test.sas7bdat')
非常簡單,似乎應(yīng)該可以工作.但我只是得到這個錯誤:
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
.
推薦答案
根據(jù)下面鏈接的問題報告,此錯誤將在 18.1 中修復(fù).
According issue report linked below, this bug will be fixed in 18.1.
https://github.com/pydata/pandas/issues/12647
這篇關(guān)于用 pandas 讀取 SAS 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!