clover / app.py
berak's picture
Update app.py
e8f59d4
raw
history blame
911 Bytes
import streamlit as st
import pandas as pd
import numpy as np
x = st.slider('Select x value')
st.write(x, 'squared is', x * x)
y = st.slider('Select y value')
st.write(y, 'times two is', y + y)
DATE_COLUMN = 'date/time'
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
'streamlit-demo-data/uber-raw-data-sep14.csv.gz')
def load_data(nrows):
data = pd.read_csv(DATA_URL, nrows=nrows)
lowercase = lambda x: str(x).lower()
data.rename(lowercase, axis='columns', inplace=True)
data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])
return data
# Create a text element and let the reader know the data is loading.
data_load_state = st.text('Loading data...')
# Load 10,000 rows of data into the dataframe.
data = load_data(10000)
# Notify the reader that the data was successfully loaded.
data_load_state.text('Loading data...done!')
#st.subheader('Raw data')
st.write(data)