This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
import pandas as pd | |
import json | |
import plotly | |
import plotly.express as px | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test the accuracy of TextBlob and VADER with tweet data from Sentiment140 | |
# This code is for educational and demonstration purposes only | |
from textblob import TextBlob | |
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer | |
import pandas as pd | |
def rounder(num): | |
return round(num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import ipywidgets as widgets | |
weather=pd.read_csv('heathrowDataFiltered.csv') | |
def fmax(year): | |
yticks = [0,5,10,15,20,25,30] | |
label="Degrees Celsius" | |
f(year, 'Tmax','line', yticks, label) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
weather=pd.read_csv('heathrowDataFiltered.csv') | |
import matplotlib.pyplot as plt | |
fig, axes = plt.subplots(nrows=2, ncols=2,figsize=(10,7)) | |
def plotchart(y,yticks,label,ax, kind): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = """ | |
__Select an application from the list below__ | |
""" | |
import json | |
import streamlit as st | |
import importlib | |
import stlib # default library name for apps | |
from stlib import libContents | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = """ | |
__Select an application from the list below__ | |
""" | |
import streamlit as st | |
st.set_page_config(layout = "wide") # optional | |
from stlib import countryData | |
from stlib import continentData | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run(): | |
import streamlit as st | |
import pandas as pd | |
import plotly.express as px | |
df = pd.DataFrame(px.data.gapminder()) | |
# Continents/Country code goes here | |
# This code allows you to run the app standalone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import pandas as pd | |
import plotly.express as px | |
st.set_page_config(layout="wide") | |
df = pd.DataFrame(px.data.gapminder()) | |
def countryData(): | |
# Countries code goes here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Continents | |
contlist = df['continent'].unique() | |
continent = st.selectbox("Select a continent:", contlist) | |
col1, col2 = st.columns(2) | |
fig = px.line(df[df['continent'] == continent], | |
x = "year", y = "gdpPercap", | |
title = "GDP per Capita",color = 'country') | |
col1.plotly_chart(fig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Countries | |
clist = df['country'].unique() | |
country = st.selectbox("Select a country:", clist) | |
col1, col2 = st.columns(2) | |
fig = px.line(df[df['country'] == country], | |
x="year", y="gdpPercap", title="GDP per Capita") | |
col1.plotly_chart(fig, use_container_width=True) |
OlderNewer