Python Pandas DataFrame to sas xtp

Today I will show you how to export pandas DataFrame to sas xtp file using python

For this, you need to install pandas and pyreadstat

pip install pandas
pip install pyreadstat

Read the data frame

import pandas as pddf = pd.read_csv("filename.csv")

Export to as xpt fromat

path = "file_name.xpt"
pyreadstat.write_xport(df, path)

That's it. Thanks for reading.

#Datascience #Deeplearning #AI