aboutsummaryrefslogtreecommitdiff
path: root/predictor.py
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-12-25 17:17:02 -0500
committerPriyansh <[email protected]>2021-12-25 17:17:02 -0500
commitcb1e6c587ebef823b8524d72c1a97ab5765901d8 (patch)
tree7ef2d647d44ce2bfbbe66d9c6f1eea62fe5dbea6 /predictor.py
parent4ab10ff5a9588f535a2d8d7f8b7b93a237d1e03b (diff)
downloadKafkaPySpark-cb1e6c587ebef823b8524d72c1a97ab5765901d8.tar.xz
KafkaPySpark-cb1e6c587ebef823b8524d72c1a97ab5765901d8.zip
Analysed Sentiment and Plotted a plot
Diffstat (limited to 'predictor.py')
-rw-r--r--predictor.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/predictor.py b/predictor.py
new file mode 100644
index 0000000..77a0343
--- /dev/null
+++ b/predictor.py
@@ -0,0 +1,9 @@
+import pandas as pd
+import matplotlib.pyplot as plt
+
+tweets = pd.read_csv('tweets.csv')
+
+# Plot the number of tweets by sentiment
+tweets.groupby('sentiment').count()['tweet'].plot.bar()
+plt.show()
+