Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,4 +3,23 @@ import streamlit as st
|
|
3 |
x = st.slider('Select x value')
|
4 |
st.write(x, 'squared is', x * x)
|
5 |
y = st.slider('Select y value')
|
6 |
-
st.write(y, 'times two is', y + y)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
x = st.slider('Select x value')
|
4 |
st.write(x, 'squared is', x * x)
|
5 |
y = st.slider('Select y value')
|
6 |
+
st.write(y, 'times two is', y + y)
|
7 |
+
|
8 |
+
DATE_COLUMN = 'date/time'
|
9 |
+
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
|
10 |
+
'streamlit-demo-data/uber-raw-data-sep14.csv.gz')
|
11 |
+
|
12 |
+
def load_data(nrows):
|
13 |
+
data = pd.read_csv(DATA_URL, nrows=nrows)
|
14 |
+
lowercase = lambda x: str(x).lower()
|
15 |
+
data.rename(lowercase, axis='columns', inplace=True)
|
16 |
+
data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])
|
17 |
+
return data
|
18 |
+
|
19 |
+
# Create a text element and let the reader know the data is loading.
|
20 |
+
data_load_state = st.text('Loading data...')
|
21 |
+
# Load 10,000 rows of data into the dataframe.
|
22 |
+
data = load_data(10000)
|
23 |
+
# Notify the reader that the data was successfully loaded.
|
24 |
+
data_load_state.text('Loading data...done!')
|
25 |
+
|