Issue
How can I export the output of this previous cell to a .csv file?
Solution
Assuming that you are trying to write a dictionary to a csv file, I recommend pandas for this, you can also use csv but this is faster.
import pandas as pd
vm = {'rs963837': None, 'rs9895661': 'BCAS3', 'rs10277115': None, 'rs62435145': None, 'rs13230509': None, 'rs13230625': None, 'rs11761603': None, 'rs12702509': None}
df = pd.DataFrame.from_dict(vm,orient='index')
print(df)
My output looks like this
0
rs963837 None
rs9895661 BCAS3
rs10277115 None
rs62435145 None
rs13230509 None
rs13230625 None
rs11761603 None
rs12702509 None
next you can just do the following to save the dataframe as a csv file.
df.to_csv('filename.csv',index=True)
Answered By - anarchy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.