Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
| 344 |
|
| 345 |
-
|
| 346 |
|
| 347 |
-
|
| 348 |
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 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 |
|