Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,13 +82,12 @@ def score_news(parsed_news_df):
|
|
| 82 |
# Join the DataFrames of the news and the list of dicts
|
| 83 |
parsed_and_scored_news = parsed_news_df.join(scores_df, rsuffix='_right')
|
| 84 |
parsed_and_scored_news = parsed_and_scored_news.set_index('datetime')
|
| 85 |
-
parsed_and_scored_news = parsed_and_scored_news.drop(['date', 'time'], axis=1) # Corrected line
|
| 86 |
parsed_and_scored_news = parsed_and_scored_news.rename(columns={"compound": "sentiment_score"})
|
| 87 |
|
| 88 |
-
|
| 89 |
return parsed_and_scored_news
|
| 90 |
|
| 91 |
|
|
|
|
| 92 |
def plot_hourly_sentiment(parsed_and_scored_news, ticker):
|
| 93 |
# Ensure that only numeric columns are resampled
|
| 94 |
numeric_cols = parsed_and_scored_news.select_dtypes(include=['float64', 'int64'])
|
|
|
|
| 82 |
# Join the DataFrames of the news and the list of dicts
|
| 83 |
parsed_and_scored_news = parsed_news_df.join(scores_df, rsuffix='_right')
|
| 84 |
parsed_and_scored_news = parsed_and_scored_news.set_index('datetime')
|
|
|
|
| 85 |
parsed_and_scored_news = parsed_and_scored_news.rename(columns={"compound": "sentiment_score"})
|
| 86 |
|
|
|
|
| 87 |
return parsed_and_scored_news
|
| 88 |
|
| 89 |
|
| 90 |
+
|
| 91 |
def plot_hourly_sentiment(parsed_and_scored_news, ticker):
|
| 92 |
# Ensure that only numeric columns are resampled
|
| 93 |
numeric_cols = parsed_and_scored_news.select_dtypes(include=['float64', 'int64'])
|