Spaces:
Sleeping
Sleeping
Alealejandrooo
commited on
Commit
•
9d0c835
1
Parent(s):
8684f0c
Delete gradio/ingest.py
Browse files- gradio/ingest.py +0 -15
gradio/ingest.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
import pandas as pd
|
2 |
-
|
3 |
-
def load_data(filepath):
|
4 |
-
# Check the file extension and load the file accordingly
|
5 |
-
if filepath.endswith('.csv'):
|
6 |
-
df = pd.read_csv(filepath)
|
7 |
-
elif filepath.endswith('.xlsx') or filepath.endswith('.xls'):
|
8 |
-
df = pd.read_excel(filepath)
|
9 |
-
else:
|
10 |
-
raise ValueError("Unsupported file format: Please provide a .csv or .xlsx file")
|
11 |
-
|
12 |
-
# Convert all string values to lowercase and remove spaces
|
13 |
-
df = df.map(lambda x: x.lower().replace(" ", "") if isinstance(x, str) else x)
|
14 |
-
|
15 |
-
return df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|