James McCool
commited on
Commit
·
b23e7d2
1
Parent(s):
cbe8e8b
one more change
Browse files
app.py
CHANGED
|
@@ -1799,7 +1799,6 @@ if selected_tab == 'Projections Management':
|
|
| 1799 |
column_config = {
|
| 1800 |
'player_names': st.column_config.TextColumn(
|
| 1801 |
'Player',
|
| 1802 |
-
disabled=True,
|
| 1803 |
width='medium'
|
| 1804 |
),
|
| 1805 |
'position': st.column_config.TextColumn(
|
|
@@ -1874,7 +1873,7 @@ if selected_tab == 'Projections Management':
|
|
| 1874 |
# Check for changes and update
|
| 1875 |
if not edited_df.equals(filtered_df):
|
| 1876 |
# Find which rows changed
|
| 1877 |
-
changed_mask = ~(edited_df[['position', 'team', 'salary', 'median', 'ownership', 'captain ownership']] == filtered_df[['position', 'team', 'salary', 'median', 'ownership', 'captain ownership']]).all(axis=1)
|
| 1878 |
changed_rows = edited_df[changed_mask]
|
| 1879 |
|
| 1880 |
if len(changed_rows) > 0:
|
|
@@ -1886,6 +1885,7 @@ if selected_tab == 'Projections Management':
|
|
| 1886 |
orig_idx = st.session_state['projections_df'][st.session_state['projections_df']['player_names'] == player_name].index
|
| 1887 |
if len(orig_idx) > 0:
|
| 1888 |
# Player exists in projections_df - update existing row
|
|
|
|
| 1889 |
st.session_state['projections_df'].loc[orig_idx[0], 'position'] = row['position']
|
| 1890 |
st.session_state['projections_df'].loc[orig_idx[0], 'team'] = row['team']
|
| 1891 |
st.session_state['projections_df'].loc[orig_idx[0], 'salary'] = row['salary']
|
|
|
|
| 1799 |
column_config = {
|
| 1800 |
'player_names': st.column_config.TextColumn(
|
| 1801 |
'Player',
|
|
|
|
| 1802 |
width='medium'
|
| 1803 |
),
|
| 1804 |
'position': st.column_config.TextColumn(
|
|
|
|
| 1873 |
# Check for changes and update
|
| 1874 |
if not edited_df.equals(filtered_df):
|
| 1875 |
# Find which rows changed
|
| 1876 |
+
changed_mask = ~(edited_df[['player_names', 'position', 'team', 'salary', 'median', 'ownership', 'captain ownership']] == filtered_df[['player_names', 'position', 'team', 'salary', 'median', 'ownership', 'captain ownership']]).all(axis=1)
|
| 1877 |
changed_rows = edited_df[changed_mask]
|
| 1878 |
|
| 1879 |
if len(changed_rows) > 0:
|
|
|
|
| 1885 |
orig_idx = st.session_state['projections_df'][st.session_state['projections_df']['player_names'] == player_name].index
|
| 1886 |
if len(orig_idx) > 0:
|
| 1887 |
# Player exists in projections_df - update existing row
|
| 1888 |
+
st.session_state['projections_df'].loc[orig_idx[0], 'player_names'] = row['player_names']
|
| 1889 |
st.session_state['projections_df'].loc[orig_idx[0], 'position'] = row['position']
|
| 1890 |
st.session_state['projections_df'].loc[orig_idx[0], 'team'] = row['team']
|
| 1891 |
st.session_state['projections_df'].loc[orig_idx[0], 'salary'] = row['salary']
|