Skip to content

Commit

Permalink
Merge pull request #4976 from plotly/update-docs-for-dataframes
Browse files Browse the repository at this point in the history
Add note on dicts and arrays conversion to Pandas
  • Loading branch information
LiamConnors authored Jan 23, 2025
2 parents 3d36f14 + 357ad0c commit 0ca20aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/python/px-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ fig = px.density_contour(dict(effect_size=5 + np.random.randn(N),
fig.show()
```

To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.

#### Integer column names

When the `data_frame` argument is a NumPy array, column names are integer corresponding to the columns of the array. In this case, keyword names are used in axis, legend and hovers. This is also the case for a pandas DataFrame with integer column names. Use the `labels` argument to override these names.
Expand Down

0 comments on commit 0ca20aa

Please sign in to comment.