From 2aa76bfb1637d534b0758088dea86b7fdafa2cfc Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 21 Jan 2025 15:21:17 -0500 Subject: [PATCH 1/2] add note on dicts and arrays --- doc/python/px-arguments.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/python/px-arguments.md b/doc/python/px-arguments.md index 5132b03c65..ac10d67d1c 100644 --- a/doc/python/px-arguments.md +++ b/doc/python/px-arguments.md @@ -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. From 357ad0c450d5ba2d6f85351c0aa5722c69831a62 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 22 Jan 2025 10:53:27 -0500 Subject: [PATCH 2/2] Update doc/python/px-arguments.md --- doc/python/px-arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/px-arguments.md b/doc/python/px-arguments.md index ac10d67d1c..308a8d02bd 100644 --- a/doc/python/px-arguments.md +++ b/doc/python/px-arguments.md @@ -244,7 +244,7 @@ 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. +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