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: python/px-arguments.md
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.3
23
+
version: 3.6.8
24
24
plotly:
25
25
description: Arguments accepted by plotly express functions
26
26
display_as: file_settings
@@ -41,6 +41,38 @@ jupyter:
41
41
42
42
See also the [introduction to plotly express](./plotly-express).
43
43
44
+
45
+
### Tidy Data
46
+
47
+
Plotly Express operates on "tidy" or "long" data rather than "wide" data. You may pass data in either as a Pandas `DataFrame` objects or as individual array-like objects which PX will assemble into a data frame internally, such as lists, `numpy` arrays or Pandas `Series` objects.
48
+
49
+
What follows is a very short example of the difference between wide and tidy/long data, and the excellent [Tidy Data in Python blog post](https://www.jeannicholashould.com/tidy-data-in-python.html) contains much more information about the tidy approach to structuring data.
50
+
51
+
```python
52
+
import pandas as pd
53
+
print("This is 'wide' data, unsuitable as-is for Plotly Express:")
`px` functions supports natively pandas DataFrame. Arguments can either be passed as dataframe columns, or as column names if the `data_frame` argument is provided.
0 commit comments