Created
October 22, 2019 17:14
-
-
Save Rajan-sust/0aae51e88e8d6b665e6c2126ab771798 to your computer and use it in GitHub Desktop.
Saving dataframe as a tsv file format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import pandas library | |
import pandas as pd | |
# initialize list of lists | |
data = [['tom', 10], ['nick', 15], ['juli', 14]] | |
# Create the pandas DataFrame | |
df = pd.DataFrame(data, columns = ['Name', 'Age']) | |
df.to_csv('filename.tsv', sep = '\t', encoding='utf-8', index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment