We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi is there a function to convert csv to xpt? (Reverse of listed xpt to csv file)
Thanks, Sagar
The text was updated successfully, but these errors were encountered:
Read the .csv into a dataframe:
df = pd.read_csv('file.csv')
Convert the dataframe to a list of dictionaries to then write to .xpt:
data = df.T.to_dict().values()
Write the list of dictionaries to .xpt:
with open('file.xpt', 'wb') as f: xport.from_rows(data, f)
Sorry, something went wrong.
I've updated the README.
No branches or pull requests
Hi is there a function to convert csv to xpt? (Reverse of listed xpt to csv file)
Thanks,
Sagar
The text was updated successfully, but these errors were encountered: