johnowhitaker commited on
Commit
f42cc17
1 Parent(s): 6796bfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -96,6 +96,7 @@ if submitted:
96
  st.write("Resulting dataframe shape:", tweets.shape)
97
  st.write("Calculating sentiments...")
98
  tweets['sentiment'] = tweets['tweet'].map(lambda s: combined_score(s))
 
99
  st.write("Average sentiment:", tweets.sentiment.mean())
100
  fig, axs = plt.subplots(1, 2)
101
  axs[0].hexbin(tweets['tweet_length'], tweets['sentiment']*1,
 
96
  st.write("Resulting dataframe shape:", tweets.shape)
97
  st.write("Calculating sentiments...")
98
  tweets['sentiment'] = tweets['tweet'].map(lambda s: combined_score(s))
99
+ tweets['tweet_length'] = tweets['tweet'].map(lambda s: len(s))
100
  st.write("Average sentiment:", tweets.sentiment.mean())
101
  fig, axs = plt.subplots(1, 2)
102
  axs[0].hexbin(tweets['tweet_length'], tweets['sentiment']*1,