KitDocumentation

DataframeSave

Saves the current columns and data within a dataframe to either a csv or xlsx file. This is useful for when you have finished processing and analyzing data and are ready to save it, save checkpoints along the process of cleaning data, and debugging to see the entire values within a dataframe.

Options

fileName: Specifies the file name to save the dataframe

Examples

Example 1 - Save Dataframe to CSV Using Default Name

Use the DataframeSave kit to export the current dataframe to a CSV file. If no file name is given, the dataframe is saved using its variable name. In this case, the dataframe appleStockDf will be saved as appleStockDf.csv.
#> DataframeSave
AFLEFT 
appleStockDf.to_csv('appleStockDf.csv', index=False) AFRIGHT

Example 2 - Save Dataframe with Custom File Name

You can choose a custom file name when saving a dataframe to a CSV file. In this example, the dataframe is saved as NewAppleStock.csv instead of using the variable name.
#> DataframeSave --fileName NewAppleStock.csv
AFLEFT 
appleStockDf.to_csv('NewAppleStock.csv', index=False) AFRIGHT

Example 3 - Save Dataframe Without Specifying File Extension

If you leave off the .csv extension in the file name, it will still be added automatically. This makes it easier to quickly save a file by name without worrying about file format details.
#> DataframeSave --fileName SecondNewAppleStock
AFLEFT 
appleStockDf.to_csv('SecondNewAppleStock.csv', index=False) AFRIGHT