FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docs/python/api-examples-source/data.column_config.empty.py at main · pypae/docs · GitHub
pypae
/
docs
Public
forked from
streamlit/docs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docs
/
python
/
api-examples-source
/
data.column_config.empty.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (14 loc) · 580 Bytes
Breadcrumbs
docs
/
python
/
api-examples-source
/
data.column_config.empty.py
Copy path
File metadata and controls
17 lines (14 loc) · 580 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
streamlit
as
st
import
pandas
as
pd
df
=
pd
.
DataFrame
(
columns
=
[
"name"
,
"age"
,
"color"
])
colors
=
[
"red"
,
"orange"
,
"yellow"
,
"green"
,
"blue"
,
"indigo"
,
"violet"
]
config
=
{
"name"
:
st
.
column_config
.
TextColumn
(
"Full Name (required)"
,
width
=
"large"
,
required
=
True
),
"age"
:
st
.
column_config
.
NumberColumn
(
"Age (years)"
,
min_value
=
0
,
max_value
=
122
),
"color"
:
st
.
column_config
.
SelectboxColumn
(
"Favorite Color"
,
options
=
colors
),
}
result
=
st
.
data_editor
(
df
,
column_config
=
config
,
num_rows
=
"dynamic"
)
if
st
.
button
(
"Get results"
):
st
.
write
(
result
)
Back
|
FazBrowse Home
|
New Git URL