James McCool
commited on
Commit
·
baba885
1
Parent(s):
aef84d9
Add additional logging in 'Data Load' section of 'app.py' to display total rows, NaN counts per column, and samples of rows with NaN values, enhancing data validation during file loading.
Browse files
app.py
CHANGED
|
@@ -310,6 +310,15 @@ if selected_tab == 'Data Load':
|
|
| 310 |
st.session_state['export_portfolio'] = st.session_state['export_portfolio'].dropna(how='all')
|
| 311 |
st.session_state['export_portfolio'] = st.session_state['export_portfolio'].reset_index(drop=True)
|
| 312 |
print(st.session_state['portfolio'].isna().sum())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
st.session_state['portfolio'] = st.session_state['portfolio'].dropna(how='all')
|
| 314 |
st.session_state['portfolio'] = st.session_state['portfolio'].reset_index(drop=True)
|
| 315 |
elif upload_toggle == 'Draftkings/Fanduel (Names + IDs)':
|
|
|
|
| 310 |
st.session_state['export_portfolio'] = st.session_state['export_portfolio'].dropna(how='all')
|
| 311 |
st.session_state['export_portfolio'] = st.session_state['export_portfolio'].reset_index(drop=True)
|
| 312 |
print(st.session_state['portfolio'].isna().sum())
|
| 313 |
+
st.write(f"Total rows before dropping NaN: {len(st.session_state['portfolio'])}")
|
| 314 |
+
st.write("NaN count per column:")
|
| 315 |
+
st.write(st.session_state['portfolio'].isna().sum())
|
| 316 |
+
|
| 317 |
+
rows_with_na = st.session_state['portfolio'][st.session_state['portfolio'].isna().any(axis=1)]
|
| 318 |
+
st.write(f"Number of rows with at least one NaN: {len(rows_with_na)}")
|
| 319 |
+
if len(rows_with_na) > 0:
|
| 320 |
+
st.write("Sample of rows with NaN values:")
|
| 321 |
+
st.dataframe(rows_with_na.head(10))
|
| 322 |
st.session_state['portfolio'] = st.session_state['portfolio'].dropna(how='all')
|
| 323 |
st.session_state['portfolio'] = st.session_state['portfolio'].reset_index(drop=True)
|
| 324 |
elif upload_toggle == 'Draftkings/Fanduel (Names + IDs)':
|