Read SAS file with pandas

谁说我不能喝 提交于 2020-06-12 18:07:51

问题


I'm trying to use the pandas read_sas() function.

First, I create a SAS dataset by running this code in SAS:

libname tmp 'c:\temp';  
data tmp.test;
    do i=1 to 100;
        x=rannor(0);
        output;
    end;
run;

Now, in IPython, I do this:

import numpy as np
import pandas as pd

%cd C:\temp
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)

What am I missing here? I'm using pandas version 0.18.0.


回答1:


According issue report linked below, this bug will be fixed in 18.1.

https://github.com/pydata/pandas/issues/12647



来源:https://stackoverflow.com/questions/36310319/read-sas-file-with-pandas

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!