awacke1 commited on
Commit
17e4491
·
1 Parent(s): b00ffe2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+
3
+ def create_dataframe(file_path):
4
+ # Read the CSV file into a Pandas dataframe
5
+ df = pd.read_csv(file_path)
6
+
7
+ # Create dynamic filters for each field
8
+ filters = {}
9
+ for col in df.columns:
10
+ filters[col] = df[col].unique().tolist()
11
+
12
+ return df, filters
13
+
14
+ if __name__ == '__main__':
15
+ file_path = 'path/to/csv/file.csv'
16
+ df, filters = create_dataframe(file_path)
17
+ print('Dataframe:')
18
+ print(df)
19
+ print('\nFilters:')
20
+ print(filters)