Spaces:
Runtime error
Runtime error
import pandas as pd | |
def create_dataframe(file_path): | |
# Read the CSV file into a Pandas dataframe | |
df = pd.read_csv(file_path) | |
# Create dynamic filters for each field | |
filters = {} | |
for col in df.columns: | |
filters[col] = df[col].unique().tolist() | |
return df, filters | |
if __name__ == '__main__': | |
file_path = 'path/to/csv/file.csv' | |
df, filters = create_dataframe(file_path) | |
print('Dataframe:') | |
print(df) | |
print('\nFilters:') | |
print(filters) | |