2021-03-28

Is there a way to export a dataset I made in python to my computer?

I used two databases for a project I am working on and merged them on a common key in my code. I was wondering if there was a way to save the merged database in a .csv file on my computer so I can send it to someone or just look it at myself.

This is the code I used to merge them.

db1_in = pd.read_csv('path to ---> database1.csv', low_memory=False)
db1_in['id']=db1_in['id'].astype(int)
db2_in = pd.read_csv('path to ---> database2.csv', low_memory=False)

#combine the two databases based on their id
combined = pd.merge(db1_in, db2_in, on='id')

I just want to take that combined file and save it to my Mac as combined.csv and email it to someone or use it as one in another project. I am using Visual Studio Code.



from Recent Questions - Stack Overflow https://ift.tt/3delNQ1
https://ift.tt/eA8V8J

No comments:

Post a Comment