James McCool
commited on
Commit
·
a202d46
1
Parent(s):
4088871
fixing load_csv
Browse files- global_func/load_csv.py +2 -0
- global_func/load_file.py +0 -1
global_func/load_csv.py
CHANGED
|
@@ -9,6 +9,8 @@ def load_csv(upload):
|
|
| 9 |
try:
|
| 10 |
if isinstance(upload, pd.DataFrame):
|
| 11 |
df = upload.copy()
|
|
|
|
|
|
|
| 12 |
else:
|
| 13 |
if upload.name.endswith('.csv'):
|
| 14 |
df = pd.read_csv(upload)
|
|
|
|
| 9 |
try:
|
| 10 |
if isinstance(upload, pd.DataFrame):
|
| 11 |
df = upload.copy()
|
| 12 |
+
|
| 13 |
+
return df
|
| 14 |
else:
|
| 15 |
if upload.name.endswith('.csv'):
|
| 16 |
df = pd.read_csv(upload)
|
global_func/load_file.py
CHANGED
|
@@ -103,7 +103,6 @@ def load_file(upload, site_var, type_var, sport_var, upload_type):
|
|
| 103 |
st.error('Please upload either a CSV or Excel file')
|
| 104 |
return None, None
|
| 105 |
|
| 106 |
-
print(df.head(10))
|
| 107 |
for col in df.columns:
|
| 108 |
if isinstance(col, str) and "Unnamed" in col:
|
| 109 |
df = df.drop(columns=[col])
|
|
|
|
| 103 |
st.error('Please upload either a CSV or Excel file')
|
| 104 |
return None, None
|
| 105 |
|
|
|
|
| 106 |
for col in df.columns:
|
| 107 |
if isinstance(col, str) and "Unnamed" in col:
|
| 108 |
df = df.drop(columns=[col])
|