Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 committed Dec 14, 2023
1 parent a18f279 commit 5a9850c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion applications/data_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def analyze_symbol(self, symbol: str, news: List[News]) -> Analysis:
category=news[0].category,
symbol=symbol,
date=datetime.now().date().isoformat(),
average_sentiment=sum([item.sentiment for item in news if item.sentiment != 0]) / len(news),
average_sentiment=sum(
[item.sentiment for item in news if item.sentiment != 0]
)
/ len(news),
total_news=len(news),
positive_news=len([item for item in news if item.sentiment > 0]),
negative_news=len([item for item in news if item.sentiment < 0]),
Expand Down

0 comments on commit 5a9850c

Please sign in to comment.