Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,72 @@ import plotly.graph_objects as go
|
|
6 |
|
7 |
st.set_page_config(page_title="Plotly Graphing Libraries",layout='wide')
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
st.markdown("WebGL Rendering with 1,000,000 Points")
|
11 |
import plotly.graph_objects as go
|
|
|
6 |
|
7 |
st.set_page_config(page_title="Plotly Graphing Libraries",layout='wide')
|
8 |
|
9 |
+
import streamlit as st
|
10 |
+
|
11 |
+
uploaded_files = st.file_uploader("Choose a CSV file", accept_multiple_files=True)
|
12 |
+
for uploaded_file in uploaded_files:
|
13 |
+
bytes_data = uploaded_file.read()
|
14 |
+
st.write("filename:", uploaded_file.name)
|
15 |
+
st.write(bytes_data)
|
16 |
+
filevalue = uploaded_file.getvalue()
|
17 |
+
st.write(filevalue)
|
18 |
+
st.write(uploaded_file.name)
|
19 |
+
st.write(uploaded_file.type)
|
20 |
+
st.write(uploaded_file.size)
|
21 |
+
#st.write(uploaded_file.last_modified)
|
22 |
+
#st.write(uploaded_file.charset)
|
23 |
+
st.write(uploaded_file.getbuffer())
|
24 |
+
st.write(uploaded_file.getbuffer().nbytes)
|
25 |
+
st.write(uploaded_file.getbuffer().tobytes())
|
26 |
+
st.write(uploaded_file.getbuffer().tolist())
|
27 |
+
st.write(uploaded_file.getbuffer().itemsize)
|
28 |
+
st.write(uploaded_file.getbuffer().ndim)
|
29 |
+
st.write(uploaded_file.getbuffer().shape)
|
30 |
+
st.write(uploaded_file.getbuffer().strides)
|
31 |
+
st.write(uploaded_file.getbuffer().suboffsets)
|
32 |
+
st.write(uploaded_file.getbuffer().readonly)
|
33 |
+
st.write(uploaded_file.getbuffer().c_contiguous)
|
34 |
+
st.write(uploaded_file.getbuffer().f_contiguous)
|
35 |
+
st.write(uploaded_file.getbuffer().contiguous)
|
36 |
+
st.write(uploaded_file.getbuffer().itemsize)
|
37 |
+
st.write(uploaded_file.getbuffer().nbytes)
|
38 |
+
st.write(uploaded_file.getbuffer().ndim)
|
39 |
+
st.write(uploaded_file.getbuffer().shape)
|
40 |
+
st.write(uploaded_file.getbuffer().strides)
|
41 |
+
st.write(uploaded_file.getbuffer().suboffsets)
|
42 |
+
st.write(uploaded_file.getbuffer().readonly)
|
43 |
+
st.write(uploaded_file.getbuffer().c_contiguous)
|
44 |
+
st.write(uploaded_file.getbuffer().f_contiguous)
|
45 |
+
st.write(uploaded_file.getbuffer().contiguous)
|
46 |
+
st.write(uploaded_file.getbuffer().itemsize)
|
47 |
+
st.write(uploaded_file.getbuffer().nbytes)
|
48 |
+
st.write(uploaded_file.getbuffer().ndim)
|
49 |
+
st.write(uploaded_file.getbuffer().shape)
|
50 |
+
st.write(uploaded_file.getbuffer().strides)
|
51 |
+
st.write(uploaded_file.getbuffer().suboffsets)
|
52 |
+
st.write(uploaded_file.getbuffer().readonly)
|
53 |
+
st.write(uploaded_file.getbuffer().c_contiguous)
|
54 |
+
st.write(uploaded_file.getbuffer().f_contiguous)
|
55 |
+
|
56 |
+
|
57 |
+
#show replace
|
58 |
+
if st.checkbox("replace"):
|
59 |
+
mydf = st.dataframe(df)
|
60 |
+
columns = st.selectbox("Select column", df.columns)
|
61 |
+
old_values = st.multiselect("Current Values",list(df[columns].unique()),list(df[columns].unique()))
|
62 |
+
with st.form(key='my_form'):
|
63 |
+
col1,col2 = st.beta_columns(2)
|
64 |
+
st_input = st.number_input if is_numeric_dtype(df[columns]) else st.text_input
|
65 |
+
with col1:
|
66 |
+
old_val = st_input("old value")
|
67 |
+
with col2:
|
68 |
+
new_val = st_input("new value")
|
69 |
+
if st.form_submit_button("Replace"):
|
70 |
+
df[columns]=df[columns].replace(old_val,new_val)
|
71 |
+
st.success("{} replace with {} successfully ".format(old_val,new_val))
|
72 |
+
excel = df.to_excel(r"F:\book2.xlsx", index = False, header=True,encoding="utf-8")
|
73 |
+
df =pd.read_excel(r"F:\book2.xlsx")
|
74 |
+
mydf.add_rows(df)
|
75 |
|
76 |
st.markdown("WebGL Rendering with 1,000,000 Points")
|
77 |
import plotly.graph_objects as go
|