Skip to content

Commit

Permalink
add note on dicts and arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Jan 21, 2025
1 parent 3d36f14 commit 2aa76bf
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` argument, 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 2aa76bf

Please sign in to comment.