itsok / eda.py
wismaeka's picture
Upload 4 files
127c3c7 verified
raw
history blame
824 Bytes
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
def run():
# title
st.title('Are you ok today?')
# sub header
st.subheader('I did analysis for you!')
# lines
st.markdown('---')
# show dataframe
df = pd.read_csv('sentiments_filtered.csv')
st.dataframe(df)
# figure plot
st.write('#### Plot distribution of sentiments')
fig = plt.figure(figsize=(15, 5))
sns.countplot(x='sentiment', data=df)
st.pyplot(fig)
# histogram of word cloud
st.write('#### Histogram Plot')
option = st.selectbox('Choose column: ', ('text', 'sentiment'))
fig = plt.figure(figsize=(15, 5))
sns.histplot(df[option], bins=30, kde=True)
st.pyplot(fig)
if __name__ == '__main__':
run()