FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-python/tests/test_plotly_express.py at main · prasa397/docker-python · GitHub
prasa397
/
docker-python
Public
forked from
Kaggle/docker-python
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
docker-python
/
tests
/
test_plotly_express.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 1.27 KB
Breadcrumbs
docker-python
/
tests
/
test_plotly_express.py
Copy path
File metadata and controls
27 lines (21 loc) · 1.27 KB
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
18
19
20
21
22
23
24
25
26
27
import
unittest
import
plotly_express
as
px
class
TestPlotlyExpress
(
unittest
.
TestCase
):
def
test_basic_scatter_plot
(
self
):
gapminder
=
px
.
data
.
gapminder
()
gapminder2007
=
gapminder
.
query
(
"year == 2007"
)
px
.
scatter
(
gapminder2007
,
x
=
"gdpPercap"
,
y
=
"lifeExp"
)
def
test_complex_scatter_plot
(
self
):
gapminder
=
px
.
data
.
gapminder
()
gapminder2007
=
gapminder
.
query
(
"year == 2007"
)
px
.
scatter
(
gapminder
,
x
=
"gdpPercap"
,
y
=
"lifeExp"
,
size
=
"pop"
,
size_max
=
60
,
color
=
"continent"
,
hover_name
=
"country"
,
animation_frame
=
"year"
,
animation_group
=
"country"
,
log_x
=
True
,
range_x
=
[
100
,
100000
],
range_y
=
[
25
,
90
],
labels
=
dict
(
pop
=
"Population"
,
gdpPercap
=
"GDP per Capita"
,
lifeExp
=
"Life Expectancy"
))
def
test_choropleth_plot
(
self
):
gapminder
=
px
.
data
.
gapminder
()
gapminder2007
=
gapminder
.
query
(
"year == 2007"
)
px
.
choropleth
(
gapminder
,
locations
=
"iso_alpha"
,
color
=
"lifeExp"
,
hover_name
=
"country"
,
animation_frame
=
"year"
,
color_continuous_scale
=
px
.
colors
.
sequential
.
Plasma
,
projection
=
"natural earth"
)
def
test_violin_plot
(
self
):
tips
=
px
.
data
.
tips
()
px
.
scatter
(
tips
,
x
=
"total_bill"
,
y
=
"tip"
,
color
=
"smoker"
,
trendline
=
"ols"
,
marginal_x
=
"violin"
,
marginal_y
=
"box"
)
Back
|
FazBrowse Home
|
New Git URL