Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -247,7 +247,8 @@ with news_analysis:
|
|
| 247 |
|
| 248 |
# Load data
|
| 249 |
data_file_path = r"Events_SameDay.csv" # Update this with your file path
|
| 250 |
-
events = pd.read_csv(data_file_path)
|
|
|
|
| 251 |
|
| 252 |
# Convert 'Date' column to datetime format
|
| 253 |
events['Date'] = pd.to_datetime(events['Date'])
|
|
@@ -523,6 +524,10 @@ with trade_recs:
|
|
| 523 |
)
|
| 524 |
)
|
| 525 |
st.plotly_chart(figure)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 526 |
trade_recs = events[['Date', 'Trading_Recommendations']]
|
| 527 |
# Extract date component from the datetime column
|
| 528 |
trade_recs['Date'] = trade_recs['Date'].dt.date
|
|
|
|
| 247 |
|
| 248 |
# Load data
|
| 249 |
data_file_path = r"Events_SameDay.csv" # Update this with your file path
|
| 250 |
+
events = pd.read_csv(data_file_path, encoding="ISO-8859-1", lineterminator='\n')
|
| 251 |
+
print(events.columns)
|
| 252 |
|
| 253 |
# Convert 'Date' column to datetime format
|
| 254 |
events['Date'] = pd.to_datetime(events['Date'])
|
|
|
|
| 524 |
)
|
| 525 |
)
|
| 526 |
st.plotly_chart(figure)
|
| 527 |
+
if 'Trading_Recommendations\r' in events.columns:
|
| 528 |
+
events.rename(columns={'Trading_Recommendations\r': 'Trading_Recommendations'}, inplace=True)
|
| 529 |
+
|
| 530 |
+
print(events.columns)
|
| 531 |
trade_recs = events[['Date', 'Trading_Recommendations']]
|
| 532 |
# Extract date component from the datetime column
|
| 533 |
trade_recs['Date'] = trade_recs['Date'].dt.date
|