You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/px-arguments.md
+16-14
Original file line number
Diff line number
Diff line change
@@ -33,23 +33,23 @@ jupyter:
33
33
thumbnail: thumbnail/plotly-express.png
34
34
---
35
35
36
-
### Column-oriented, Matrix or Geographic Data
36
+
### Plotly Express works with Column-oriented, Matrix or Geographic Data
37
37
38
38
Plotly Express provides functions to visualize a variety of types of data. Most functions such as `px.bar` or `px.scatter` expect to operate on column-oriented data of the type you might store in a Pandas `DataFrame` (in either "long" or "wide" format, see below). [`px.imshow` operates on matrix-like data](/python/imshow/) you might store in a `numpy` or `xarray` array and functions like [`px.choropleth` and `px.choropleth_mapbox` can operate on geographic data](/python/maps/) of the kind you might store in a GeoPandas `GeoDataFrame`. This page details how to provide column-oriented data to most Plotly Express functions.
39
39
40
40
41
41
42
-
### Long-, Wide-, and Mixed-Form Data
42
+
### Plotly Express works with Long-, Wide-, and Mixed-Form Data
43
43
44
44
*Until version 4.8, Plotly Express only operated on long-form (previously called "tidy") data, but [now accepts wide-form and mixed-form data](/python/wide-form/) as well.*
45
45
46
46
There are three common conventions for storing column-oriented data, usually in a data frame with column names:
47
47
48
-
***long-form data** is suitable for storing multivariate data (i.e. dimensions greater than 2), with one row per observation, and one column per variable.
49
-
***wide-form data**is suitable for storing 2-dimensional data, with one row per value of one of the first variable, and one column per value of the second variable.
50
-
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables (see our[wide-form documentation](/python/wide-form/) for examples of how to use Plotly Express to visualize this kind of data)
48
+
***long-form data**has one row per observation, and one column per variable. This is suitable for storing and displaying multivariate data i.e. with dimension greater than 2. This format is sometimes called "tidy".
49
+
***wide-form data**has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.
50
+
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables. See the[wide-form documentation](/python/wide-form/) for examples of how to use Plotly Express to visualize this kind of data.
51
51
52
-
All Plotly Express functions can operate on long-form data, and the following 2D-Cartesian functions can operate on wide-form data as well::`px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`. Read on for a short example of the differences between these forms, or check out our [detailed documentation about wide-form support](/python/wide-form/).
52
+
Every Plotly Express function other than `imshow`can operate on long-form data, and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data:`px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
53
53
54
54
By way of example here is the same data, represented in long-form first, and then in wide-form:
List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[<n>].name = "name"`.
Copy file name to clipboardExpand all lines: doc/python/wide-form.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -34,21 +34,21 @@ jupyter:
34
34
thumbnail: thumbnail/plotly-express.png
35
35
---
36
36
37
-
### Plotly Express with Column-oriented, Matrix or Geographic Data
37
+
### Plotly Express works with Column-oriented, Matrix or Geographic Data
38
38
39
39
Plotly Express provides functions to visualize a variety of types of data. Most functions such as `px.bar` or `px.scatter` expect to operate on column-oriented data of the type you might store in a Pandas `DataFrame` (in either "long" or "wide" format, see below). [`px.imshow` operates on matrix-like data](/python/imshow/) you might store in a `numpy` or `xarray` array and functions like [`px.choropleth` and `px.choropleth_mapbox` can operate on geographic data](/python/maps/) of the kind you might store in a GeoPandas `GeoDataFrame`. This page details how to provide a specific form of column-oriented data to 2D-Cartesian Plotly Express functions, but you can also check out our [detailed column-input-format documentation](/python/px-arguments/).
40
40
41
-
### Plotly Express with Long-, Wide-, and Mixed-Form Data
41
+
### Plotly Express works with Long-, Wide-, and Mixed-Form Data
42
42
43
43
*Until version 4.8, Plotly Express only operated on long-form (previously called "tidy") data, but now accepts wide-form and mixed-form data as well.*
44
44
45
45
There are three common conventions for storing column-oriented data, usually in a data frame with column names:
46
46
47
-
***long-form data** is suitable for storing multivariate data (i.e. dimensions greater than 2), with one row per observation, and one column per variable.
48
-
***wide-form data**is suitable for storing 2-dimensional data, with one row per value of one of the first variable, and one column per value of the second variable.
49
-
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables
47
+
***long-form data**has one row per observation, and one column per variable. This is suitable for storing and displaying multivariate data i.e. with dimension greater than 2. This format is sometimes called "tidy".
48
+
***wide-form data**has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.
49
+
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables.
50
50
51
-
All Plotly Express functions other than `imshow` can operate on long-form data, and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
51
+
Every Plotly Express function other than `imshow` can operate on long-form data, and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
52
52
53
53
By way of example here is the same data, represented in long-form first, and then in wide-form:
0 commit comments