CSV files

Upload CSV files as a data source to be consumed by your Python script.

You can upload any file type to a CalcTree page, and the uploaded files will be available to Python scripts.

For example, click on File Upload to select a CSV file from your local drive to upload to CalcTree. Use the sample CSV file below. After uploading, the file appears on the right-hand panel, and is accessible to Python via ct.page_files['file_name']. See example below:

Use Python to interact with the uploaded file. Here's an example of how you might load the Load_Pattern_Definitions.csv into a pandas dataframe.

import pandas as pd

def read_csv(csv):
    return pd.read_csv(ct.page_files[csv]).astype('object').fillna("")
    
load_patterns_df = read_csv("Load_Pattern_Definitions.csv")

Last updated