datascience.tables.Table.to_csv¶
- Table.to_csv(filename)[source]¶
Creates a CSV file with the provided filename.
The CSV is created in such a way that if we run
table.to_csv('my_table.csv')
we can recreate the same table withTable.read_table('my_table.csv')
.- Args:
filename
(str): The filename of the output CSV file.- Returns:
None, outputs a file with name
filename
.
>>> jobs = Table().with_columns( ... 'job', make_array('a', 'b', 'c', 'd'), ... 'wage', make_array(10, 20, 15, 8)) >>> jobs job | wage a | 10 b | 20 c | 15 d | 8 >>> jobs.to_csv('my_table.csv') <outputs a file called my_table.csv in the current directory>