GOKULSINGHSHAH123 commited on
Commit
c25e568
·
verified ·
1 Parent(s): 95184e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -52,8 +52,6 @@ if option:
52
 
53
 
54
 
55
- df2 = pd.read_csv('df.csv')
56
-
57
 
58
  def convert_str_to_list_or_keep(value):
59
  if isinstance(value, str):
@@ -65,7 +63,6 @@ def convert_str_to_list_or_keep(value):
65
  return value
66
 
67
  df = df.apply(lambda col: col.map(convert_str_to_list_or_keep))
68
- df2 = df2.apply(lambda col: col.map(convert_str_to_list_or_keep))
69
 
70
  df['positionClosed'] = False
71
 
@@ -339,20 +336,20 @@ if df is not None and uid_input:
339
 
340
  unique_lists =[]
341
 
342
- elif option == "Show Live Positions":
343
- filtered_df2 = df2[df2['U_IDs'] == uid_input]
344
 
345
- if not filtered_df2.empty:
346
 
347
- positions_list = filtered_df2['Positions'].iloc[0] # Extract the first match
348
 
349
- # Convert the list of dictionaries to a DataFrame
350
- if isinstance(positions_list, list) and positions_list:
351
- positions_df = pd.DataFrame(positions_list)
352
- st.subheader("Live Positions")
353
- st.dataframe(positions_df)
354
- else:
355
- st.write("No live positions data available for the given U_ID.")
356
 
357
 
358
 
 
52
 
53
 
54
 
 
 
55
 
56
  def convert_str_to_list_or_keep(value):
57
  if isinstance(value, str):
 
63
  return value
64
 
65
  df = df.apply(lambda col: col.map(convert_str_to_list_or_keep))
 
66
 
67
  df['positionClosed'] = False
68
 
 
336
 
337
  unique_lists =[]
338
 
339
+ # elif option == "Show Live Positions":
340
+ # filtered_df2 = df2[df2['U_IDs'] == uid_input]
341
 
342
+ # if not filtered_df2.empty:
343
 
344
+ # positions_list = filtered_df2['Positions'].iloc[0] # Extract the first match
345
 
346
+ # # Convert the list of dictionaries to a DataFrame
347
+ # if isinstance(positions_list, list) and positions_list:
348
+ # positions_df = pd.DataFrame(positions_list)
349
+ # st.subheader("Live Positions")
350
+ # st.dataframe(positions_df)
351
+ # else:
352
+ # st.write("No live positions data available for the given U_ID.")
353
 
354
 
355