Exemple #1
0
def main():
    # Loading the data
    df = get_data_ex4()
    page = st.sidebar.selectbox("Choose a page", ["Homepage", "Exploration"])

    if page == "Homepage":
        st.header('­Ъда Covid-19 Vaccines Doses Applied Dashboard ­Ъда ')
        st.write("Please select a page on the left.")
        st.sidebar.markdown('­Ъда **Covid-19 Dashborad** ­Ъда ')
        st.sidebar.markdown(''' 
        This app is to give insights about Covid-19 Vaccines in PERU.
        The data considered for this analysis was obtained from MINSA Open data website
        https://www.datosabiertos.gob.pe/dataset/vacunaci%C3%B3n-contra-covid-19-ministerio-de-salud-minsa
        Select the different options to play with the Visualization
        All the Charts are interactive. 
        Scroll the mouse over the Charts to feel the interactive features like Tool tip, Zoom, Pan
                            
        Designed by:
        **Javier Caparo**  ''')

        #st.write(df.dtypes)
        today = datetime.date.today()
        st.write('Today is:', today)
        st.write('# of doses already applied', len(df.index))
        st.dataframe(df.head(5))
        # Load a lottie animation
        lottie_url = "https://assets3.lottiefiles.com/packages/lf20_1pf6yomw.json"
        lottie_json = load_lottieurl(lottie_url)
        st_lottie(lottie_json)
    elif page == "Exploration":
        st.title("Data Exploration")
        st.header('Grouped by SEX & RISK GROUP')
        visualize_data(df)
Exemple #2
0
from matplotlib.figure import Figure
from PIL import Image
import gender_guesser.detector as gender
from streamlit_lottie import st_lottie
import requests

st.set_page_config(layout="wide")

def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()

lottie_book = load_lottieurl('https://assets4.lottiefiles.com/temp/lf20_aKAfIn.json')
st_lottie(lottie_book, speed=1, height=200, key="initial")


matplotlib.use("agg")

_lock = RendererAgg.lock


sns.set_style('darkgrid')
row0_spacer1, row0_1, row0_spacer2, row0_2, row0_spacer3 = st.columns(
    (.1, 2, .2, 1, .1))

row0_1.title('Analyzing Your Goodreads Reading Habits')


with row0_2:
import pandas as pd
import requests

password_attempt = st.text_input('Please Enter The Password')
if password_attempt != 'example_password':
	st.write('Incorrect Password!')
	st.stop()

def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()

lottie_airplane = load_lottieurl('https://assets4.lottiefiles.com/packages/lf20_jhu1lqdz.json')
st_lottie(lottie_airplane, speed=1, height=200, key="initial")

st.title('Major US Airline Job Application')
st.write('by Tyler Richards')
st.subheader('Question 1: Airport Distance')
'''
The first exercise asks us 'Given the table of airports and 
locations (in latitude and longitude) below, 
write a function that takes an airport code as input and 
returns the airports listed from nearest to furthest from 
the input airport.' There are three steps here:

1. Load Data
2. Implement Distance Algorithm
3. Apply distance formula across all airports other than the input
4. Return sorted list of airports Distance
import datetime as dt
import matplotlib.pyplot as plt
from streamlit_lottie import st_lottie
import requests


def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()


lottie_tree = load_lottieurl(
    'https://assets7.lottiefiles.com/temp/lf20_yww8EW.json')
st_lottie(lottie_tree, speed=1, height=100, key="initial")

st.title('SF Trees')
st.write('This app analyses trees in San Francisco using'
         ' a dataset kindly provided by SF DPW. The '
         'histogram below is filtered by tree owner.')

#load trees dataset, add age column in days
trees_df = pd.read_csv('trees.csv')
trees_df['age'] = (pd.to_datetime('today') -
                   pd.to_datetime(trees_df['date'])).dt.days
#add tree owner filter to sidebar, then filter, get color
owners = st.sidebar.multiselect('Tree Owner Filter',
                                trees_df['caretaker'].unique())
graph_color = st.sidebar.color_picker('Graph Colors')
if owners:
Exemple #5
0
#st.image(image, use_column_width = False)

from streamlit_lottie import st_lottie


def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()


lottie_url = "https://assets6.lottiefiles.com/packages/lf20_arq6m8vt.json"
lottie_json = load_lottieurl(lottie_url)
st_lottie(lottie_json)
#st_lottie('https://assets6.lottiefiles.com/packages/lf20_arq6m8vt.json', key="user")

st.write("""
# INSTAGRAM ACCOUNT INSIGHTS 
""")

params = getCreds()  # get creds

response = getUserInsights(params)  # get insights for a user

#follower_count = response['json_data']['data'][0]['values'][0]['value']
impressions = response['json_data']['data'][0]['values'][0]['value']
profile_views = response['json_data']['data'][1]['values'][0]['value']
reach = response['json_data']['data'][2]['values'][0]['value']
)
st.header('File Uploader')
filez = st.file_uploader('Upload the file containing your whatsapp data')
if filez is not None:
    whatsapp_df = copy.deepcopy(convert_file_to_df(filez))

    st.header('Word Cloud Generator')
    col1, col2 = st.beta_columns(2)
    with col1:
        want_wc = st.button(
            'Click here to view the word cloud, keep in mind generating it will take some time'
        )
    if want_wc == True:
        placeholder1 = col2.empty()
        with placeholder1:
            st_lottie(lottie_json, loop=True, height=50, width=50, key='a')
        st.image(generate_wordcloud(whatsapp_df).to_image(),
                 use_column_width=True)
        placeholder1.empty()

    st.header('Messages sent per person')
    col3, col4 = st.beta_columns(2)
    with col3:
        want_mpp = st.button(
            'Click here to generate the number of messages sent per person')
    if want_mpp == True:
        placeholder2 = col4.empty()
        with placeholder2:
            st_lottie(lottie_json, loop=True, height=50, width=50, key='b')
        st.dataframe(messages_per_person(whatsapp_df))
        placeholder2.empty()
import matplotlib.pyplot as plt
import seaborn as sns
from pandas_profiling import ProfileReport
from streamlit_pandas_profiling import st_profile_report


def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()


lottie_penguin = load_lottieurl(
    'https://assets9.lottiefiles.com/private_files/lf30_lntyk83o.json')
st_lottie(lottie_penguin, speed=1.5, width=800, height=400)

st.title("Palmer's Penguins")
st.markdown(
    'Use this Streamlit app to make your own scatterplot about penguins!')

selected_x_var = st.selectbox(
    'What do want the x variable to be?',
    ['bill_length_mm', 'bill_depth_mm', 'flipper_length_mm', 'body_mass_g'])
selected_y_var = st.selectbox(
    'What about the y?',
    ['bill_depth_mm', 'bill_length_mm', 'flipper_length_mm', 'body_mass_g'])

penguin_file = st.file_uploader('Select Your Local Penguins CSV')
if penguin_file is not None:
    penguins_df = pd.read_csv(penguin_file)
Exemple #8
0
    return r.json()


lottie_url = "https://assets10.lottiefiles.com/temporary_files/EGBZKv.json"
lottie_json = load_lottieurl(lottie_url)

col1, col2, col3 = st.beta_columns([8, 1, 2])

with col1:
    st.title('Technica Finance Dashboard')

with col2:
    st.write("")

with col3:
    st_lottie(lottie_json, speed=1, height=100)


def create_df():
    df = pd.read_csv(CSV_TITLE)
    df[['Debit', 'Credit']] = df[['Debit', 'Credit']].apply(pd.to_numeric)
    df = df.fillna(0)
    df['Credit/Debit'] = df['Credit'] - df['Debit']
    df = df.iloc[::-1]
    df['Resulting Balance'] = STARTING_BALANCE + df['Credit/Debit'].cumsum()
    df['Date'] = pd.to_datetime(df['Posted Date'])
    return df


def get_data(df, month):
    current_balance = df['Resulting Balance'].iloc[-1]
Exemple #9
0
st.title("Hello Lottie!")
st.markdown(
    """
[Lottie](https://airbnb.io/lottie) is a library that parses [Adobe After Effects](http://www.adobe.com/products/aftereffects.html) animations 
exported as json with [Bodymovin](https://github.com/airbnb/lottie-web) and renders them natively on mobile and on the web!

Go look at the [awesome animations](https://lottiefiles.com/) to spice your Streamlit app!
"""
)

with st.sidebar:
    st.header("Animation parameters")
    speed = st.slider("Select speed", 0.1, 2.0, 1.0)
    reverse = st.checkbox("Reverse direction", False)
st_lottie(lottie_streamlit, speed=speed, reverse=reverse, height=400, key="initial")

with st.sidebar:
    st.markdown("---")
    st.markdown(
        '<h6>Made in &nbsp<img src="https://streamlit.io/images/brand/streamlit-mark-color.png" alt="Streamlit logo" height="16">&nbsp by <a href="https://twitter.com/andfanilo">@andfanilo</a></h6>',
        unsafe_allow_html=True
    )
    st.markdown(
        '<div style="margin-top: 0.75em;"><a href="https://www.buymeacoffee.com/andfanilo" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a></div>',
        unsafe_allow_html=True
    )

c_col1, colx, c_col2, coly = st.columns((1, 0.1, 0.25, 1))
if c_col1.button("Run some heavy computation...for 5 seconds!"):
    with c_col2.empty():
Exemple #10
0
import components
import utils
from validation import Vector

st.set_page_config(
    page_title="Vector Validator",
    layout="centered",
    page_icon="🔻",
    initial_sidebar_state="collapsed",
)

col1_header, col2_header = st.beta_columns([1, 6])
lottie_url = "https://assets10.lottiefiles.com/temp/lf20_YQB3X3.json"
lottie_json = utils.load_lottieurl(lottie_url)
with col1_header:
    st_lottie(lottie_json, height=100, speed=1)

col2_header.write("")
col2_header.title(f"Vector Validator")
st.markdown(
    "[![Star](https://img.shields.io/github/stars/chrieke/vector-validator.svg?logo=github&style=social)](https://gitHub.com/chrieke/vector-validator)"
    "&nbsp&nbsp&nbsp[![Follow](https://img.shields.io/twitter/follow/chrieke?style=social)](https://www.twitter.com/chrieke)"
)
st.write("")
st.markdown(
    "**Validates and automatically fixes your geospatial vector data.** <br> Select the validation options, "
    "upload/paste your vector data or try one of the examples.",
    unsafe_allow_html=True,
)

validation_criteria = components.config()