f64 commited on
Commit ·
b7a9316
1
Parent(s): ed3ce54
- app.py +9 -4
- pages/9_Таблица_результатов.py +2 -1
- static/test.ipynb +20 -19
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
|
| 3 |
st.set_page_config(page_title="Предсказание V", page_icon="🦋", layout="wide") # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
|
|
@@ -8,11 +9,15 @@ st.html(my_stm.STYLE_CORRECTION)
|
|
| 8 |
st.sidebar.markdown("💎 Стартовая страница")
|
| 9 |
|
| 10 |
df = pd.DataFrame([
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
])
|
| 15 |
|
| 16 |
edited_df = st.sidebar.data_editor(df, num_rows="dynamic")
|
| 17 |
favorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]
|
| 18 |
-
st.sidebar.markdown(f"Your favorite command is **{favorite_command}** 🎚️")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os, re, sys, time, math, shutil, urllib, string, random, pickle, zipfile, datetime
|
| 2 |
import streamlit as st, pandas as pd, numpy as np
|
| 3 |
|
| 4 |
st.set_page_config(page_title="Предсказание V", page_icon="🦋", layout="wide") # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
|
|
|
|
| 9 |
st.sidebar.markdown("💎 Стартовая страница")
|
| 10 |
|
| 11 |
df = pd.DataFrame([
|
| 12 |
+
{"command": "st.selectbox", "rating": 4, "is_widget": True},
|
| 13 |
+
{"command": "st.balloons", "rating": 5, "is_widget": False},
|
| 14 |
+
{"command": "st.time_input", "rating": 3, "is_widget": True},
|
| 15 |
])
|
| 16 |
|
| 17 |
edited_df = st.sidebar.data_editor(df, num_rows="dynamic")
|
| 18 |
favorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]
|
| 19 |
+
st.sidebar.markdown(f"Your favorite command is **{favorite_command}** 🎚️")
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
with st.container():
|
| 23 |
+
st.write(os.getcwd())
|
pages/9_Таблица_результатов.py
CHANGED
|
@@ -3,4 +3,5 @@ import my_static_methods as my_stm
|
|
| 3 |
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 4 |
|
| 5 |
st.sidebar.markdown("### просто таблица случайных чисел - пока заглушка ❄️")
|
| 6 |
-
st.
|
|
|
|
|
|
| 3 |
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 4 |
|
| 5 |
st.sidebar.markdown("### просто таблица случайных чисел - пока заглушка ❄️")
|
| 6 |
+
pop = st.sidebar.popover("Open popover")
|
| 7 |
+
pop.dataframe(my_stm.df_random_dataframe())
|
static/test.ipynb
CHANGED
|
@@ -454,7 +454,7 @@
|
|
| 454 |
},
|
| 455 |
{
|
| 456 |
"cell_type": "code",
|
| 457 |
-
"execution_count":
|
| 458 |
"metadata": {},
|
| 459 |
"outputs": [
|
| 460 |
{
|
|
@@ -500,7 +500,7 @@
|
|
| 500 |
"dtype: int64"
|
| 501 |
]
|
| 502 |
},
|
| 503 |
-
"execution_count":
|
| 504 |
"metadata": {},
|
| 505 |
"output_type": "execute_result"
|
| 506 |
}
|
|
@@ -512,35 +512,36 @@
|
|
| 512 |
},
|
| 513 |
{
|
| 514 |
"cell_type": "code",
|
| 515 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
"metadata": {},
|
| 517 |
"outputs": [
|
| 518 |
-
{
|
| 519 |
-
"name": "stderr",
|
| 520 |
-
"output_type": "stream",
|
| 521 |
-
"text": [
|
| 522 |
-
"C:\\Users\\f64\\AppData\\Local\\Temp\\ipykernel_6328\\3316428820.py:4: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
| 523 |
-
" set(df2.groupby(\"ID\").apply(len))\n"
|
| 524 |
-
]
|
| 525 |
-
},
|
| 526 |
{
|
| 527 |
"data": {
|
| 528 |
"text/plain": [
|
| 529 |
-
"
|
| 530 |
]
|
| 531 |
},
|
| 532 |
-
"execution_count":
|
| 533 |
"metadata": {},
|
| 534 |
"output_type": "execute_result"
|
| 535 |
}
|
| 536 |
],
|
| 537 |
"source": [
|
| 538 |
-
"
|
| 539 |
-
"#df2.groupby(\"ID\").apply(lambda df: type(df))\n",
|
| 540 |
-
"#set(df2.groupby(\"ID\").apply(lambda df: len(df)).values)\n",
|
| 541 |
-
"\n",
|
| 542 |
-
"#df2.groupby(\"ID\").apply(lambda df: list(df.columns))\n",
|
| 543 |
-
"#df2.groupby(\"ID\").apply(lambda df: list(df.columns))"
|
| 544 |
]
|
| 545 |
}
|
| 546 |
],
|
|
|
|
| 454 |
},
|
| 455 |
{
|
| 456 |
"cell_type": "code",
|
| 457 |
+
"execution_count": 38,
|
| 458 |
"metadata": {},
|
| 459 |
"outputs": [
|
| 460 |
{
|
|
|
|
| 500 |
"dtype: int64"
|
| 501 |
]
|
| 502 |
},
|
| 503 |
+
"execution_count": 38,
|
| 504 |
"metadata": {},
|
| 505 |
"output_type": "execute_result"
|
| 506 |
}
|
|
|
|
| 512 |
},
|
| 513 |
{
|
| 514 |
"cell_type": "code",
|
| 515 |
+
"execution_count": 37,
|
| 516 |
+
"metadata": {},
|
| 517 |
+
"outputs": [],
|
| 518 |
+
"source": [
|
| 519 |
+
"#df2.groupby(\"ID\").apply(lambda df: df.tail(1))\n",
|
| 520 |
+
"#df2.groupby(\"ID\").apply(lambda df: type(df))\n",
|
| 521 |
+
"#set(df2.groupby(\"ID\").apply(lambda df: len(df)).values)\n",
|
| 522 |
+
"\n",
|
| 523 |
+
"#df2.groupby(\"ID\").apply(lambda df: list(df.columns))\n",
|
| 524 |
+
"#df2.groupby(\"ID\").apply(lambda df: list(df.columns))"
|
| 525 |
+
]
|
| 526 |
+
},
|
| 527 |
+
{
|
| 528 |
+
"cell_type": "code",
|
| 529 |
+
"execution_count": 40,
|
| 530 |
"metadata": {},
|
| 531 |
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 532 |
{
|
| 533 |
"data": {
|
| 534 |
"text/plain": [
|
| 535 |
+
"'n:\\\\Makarov\\\\Development\\\\HuggingFaceSpacesGit\\\\streamlit\\\\static'"
|
| 536 |
]
|
| 537 |
},
|
| 538 |
+
"execution_count": 40,
|
| 539 |
"metadata": {},
|
| 540 |
"output_type": "execute_result"
|
| 541 |
}
|
| 542 |
],
|
| 543 |
"source": [
|
| 544 |
+
"os.getcwd()"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 545 |
]
|
| 546 |
}
|
| 547 |
],
|