-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module 'xport' has no attribute 'XportReader' #55
Comments
Sorry, I changed the interface. I updated the README, so I think it'll explain it: https://github.com/selik/xport#reading-xpt |
I hope you don't mind the dependency on Pandas. Were you using Pandas already? |
@emmacwx1 I'm curious, where did you find the example code that you tried? Were those instructions from the CDC? |
Actually, the old interface is still supported. I think you meant |
Issue #55 suggests that an old version of `xport` may have had an `XportReader` class. I can't remember that, but I figure it's easy enough to toss it in.
I went ahead and tossed in |
I tried to convert NHANES data in xpt format into csv format in Jupyter notebook, and have installed xport with the following code:
`import sys
!{sys.executable} -m pip install xport
import xport, csv
with xport.XportReader('MCQ_J.xpt') as reader:
with open('MCQ_J.csv', 'rb') as out:
writer = csv.DictWriter(out, [f['name'] for f in reader.fields])
for row in reader:
writer.writerow(row)`
but I have the error that "module 'xport' has no attribute 'XportReader'", was my download package wrong or do you have advice on how to solve this?
The text was updated successfully, but these errors were encountered: