From ff4125f21b85a00352aadca74bcc5350883cfb22 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:14:55 -0400 Subject: [PATCH 01/15] update docs python version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2973d204991..3397c643041 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -448,7 +448,7 @@ jobs: docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, for example, `3.9-browsers` - - image: cimg/python:3.9-browsers + - image: cimg/python:3.10-browsers steps: - add_ssh_keys: From 44ffec4f9e53ad11f75ce912118a5d4a3b30cbe5 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:25:42 -0400 Subject: [PATCH 02/15] dependencies update --- doc/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index cfca73c8dc0..c475906c834 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,9 +4,9 @@ ipywidgets==7.7.2 jupyter-client<7 jupyter notebook -pandas==1.2.0 +pandas==2.2.2 statsmodels==0.12.1 -scipy==1.5.4 +scipy==1.13.0 patsy==0.5.1 numpy==1.19.5 plotly-geo From f4d6c760d3c480d2166b42dfcd618e89ffb31a2a Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:28:20 -0400 Subject: [PATCH 03/15] update statsmodels version --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index c475906c834..76dc5461197 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -5,7 +5,7 @@ jupyter-client<7 jupyter notebook pandas==2.2.2 -statsmodels==0.12.1 +statsmodels==0.14.2 scipy==1.13.0 patsy==0.5.1 numpy==1.19.5 From 07df63d0b10159b74b06829c301d049f42ab698b Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:29:59 -0400 Subject: [PATCH 04/15] update shapely version --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 76dc5461197..c308fb8faa7 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -13,7 +13,7 @@ plotly-geo igraph geopandas==0.8.1 pyshp==2.1.2 -shapely==1.7.1 +shapely==2.0.4 psutil requests networkx==2.6.3 From 7b4a8da606e279d706fb7970e8bc1ba5581c8907 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:34:48 -0400 Subject: [PATCH 05/15] update numpy version --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index c308fb8faa7..f0b2c0707fc 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -8,7 +8,7 @@ pandas==2.2.2 statsmodels==0.14.2 scipy==1.13.0 patsy==0.5.1 -numpy==1.19.5 +numpy==1.26.4 plotly-geo igraph geopandas==0.8.1 From 2e0654dd396e6e8bebfbed4d7ff3f2c3305b145b Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:41:52 -0400 Subject: [PATCH 06/15] Update requirements.txt --- doc/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index f0b2c0707fc..452f9e1b59a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,18 +7,18 @@ notebook pandas==2.2.2 statsmodels==0.14.2 scipy==1.13.0 -patsy==0.5.1 +patsy==0.5.6 numpy==1.26.4 plotly-geo igraph -geopandas==0.8.1 -pyshp==2.1.2 +geopandas==0.14.3 +pyshp==2.3.1 shapely==2.0.4 psutil requests networkx==2.6.3 squarify -scikit-image==0.18.1 +scikit-image==0.23.2 scikit-learn sphinx==3.5.4 sphinxcontrib-applehelp==1.0.2 From 589b30b220e495a4182940fb6b6afbf0f3225661 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 15:46:39 -0400 Subject: [PATCH 07/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 452f9e1b59a..703ac8d2537 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -16,7 +16,7 @@ pyshp==2.3.1 shapely==2.0.4 psutil requests -networkx==2.6.3 +networkx==3.3 squarify scikit-image==0.23.2 scikit-learn From d844cdd288d28583bec9b46010270a2de1c9ab4e Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 16:58:14 -0400 Subject: [PATCH 08/15] update dependencies and various code updates --- binder/requirements.txt | 6 +++--- doc/python/3d-volume.md | 2 +- doc/python/axes.md | 24 ++++++++++++++---------- doc/python/box-plots.md | 12 ++++++------ doc/python/icicle-charts.md | 9 +++++---- doc/python/mixed-subplots.md | 4 ++-- doc/python/ml-regression.md | 3 +-- doc/python/sunburst-charts.md | 9 +++++---- doc/python/treemaps.md | 17 +++++++++-------- doc/requirements.txt | 5 ++--- 10 files changed, 48 insertions(+), 43 deletions(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index 330d16a38a5..506f2922ce0 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -2,10 +2,10 @@ jupytext plotly==5.21.0 jupyter notebook -pandas==1.2.0 -statsmodels==0.12.1 +pandas==2.2.2 +statsmodels==0.14.2 scipy -patsy==0.5.1 +patsy==0.5.6 numpy plotly-geo psutil diff --git a/doc/python/3d-volume.md b/doc/python/3d-volume.md index 5dde49cf63c..c92bd4fb479 100644 --- a/doc/python/3d-volume.md +++ b/doc/python/3d-volume.md @@ -86,7 +86,7 @@ np.random.seed(0) l = 30 X, Y, Z = np.mgrid[:l, :l, :l] vol = np.zeros((l, l, l)) -pts = (l * np.random.rand(3, 15)).astype(np.int) +pts = (l * np.random.rand(3, 15)).astype(int) vol[tuple(indices for indices in pts)] = 1 from scipy import ndimage vol = ndimage.gaussian_filter(vol, 4) diff --git a/doc/python/axes.md b/doc/python/axes.md index 9c4fd1acbed..9a6ba71bbda 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -367,7 +367,7 @@ fig.show() *New in 5.19* -If `tickangle` is not explicitly set, its default value is `auto`, meaning if the label needs to be rotated to avoid labels overlapping, it will rotate by either 30 or 90 degrees. Using `autotickangles`, you can also specify a list of angles for `tickangle` to use. If `tickangle` is `auto` and you provide a list of angles to `autotickangles`, the label angle will be set to the first value in the list that prevents overlap. +If `tickangle` is not explicitly set, its default value is `auto`, meaning if the label needs to be rotated to avoid labels overlapping, it will rotate by either 30 or 90 degrees. Using `autotickangles`, you can also specify a list of angles for `tickangle` to use. If `tickangle` is `auto` and you provide a list of angles to `autotickangles`, the label angle will be set to the first value in the list that prevents overlap. ```python import plotly.express as px @@ -390,14 +390,18 @@ Here is an example. import plotly.graph_objects as go import pandas as pd -# Load and filter Apple stock data for 2016 apple_df = pd.read_csv( - "https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", - parse_dates=["Date"], - index_col="Date" + "https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv" ) -apple_df_2016 = apple_df["2016"] +# Convert 'Date' column to datetime format +apple_df['Date'] = pd.to_datetime(apple_df['Date']) + +# Set 'Date' column as index +apple_df.set_index('Date', inplace=True) + +# Filter for 2016 +apple_df_2016 = apple_df.loc['2016'] # Create figure and add line fig = go.Figure() @@ -599,7 +603,7 @@ fig.show() *New in 5.17* -You can also set just a lower or upper bound manually and have autorange applied to the other bound by setting it to `None`. In the following example, we set a an upper bound of 4.5 on the x axes, while specifying `None` for the lower bound, meaning it will use autorange. On the y axes, we set the lower bound, and use `None` for the upper bound, meaning that uses autorange. +You can also set just a lower or upper bound manually and have autorange applied to the other bound by setting it to `None`. In the following example, we set a an upper bound of 4.5 on the x axes, while specifying `None` for the lower bound, meaning it will use autorange. On the y axes, we set the lower bound, and use `None` for the upper bound, meaning that uses autorange. ```python import plotly.express as px @@ -857,7 +861,7 @@ fig.show() #### nonnegative, tozero, and normal Rangemode -When you don't specify a range, autorange is used. It's also used for bounds set to `None` when providing a `range`. +When you don't specify a range, autorange is used. It's also used for bounds set to `None` when providing a `range`. The axis auto-range calculation logic can be configured using the `rangemode` axis parameter. @@ -898,7 +902,7 @@ fig.update_xaxes(autorangeoptions=dict(maxallowed=5)) fig.show() ``` -##### Clip Minimum and Maximum +##### Clip Minimum and Maximum You can also clip an axis range at a specific maximum or minimum value with `autorangeoptions.clipmax` and `autorangeoptions.clipmin`. @@ -916,7 +920,7 @@ fig.show() ##### Specify Values to be Included -Use `autorangeoptions.include` to specify a value that should always be included within the calculated autorange. In this example, we specify that for the autorange calculated on the x-axis, 5 should be included. +Use `autorangeoptions.include` to specify a value that should always be included within the calculated autorange. In this example, we specify that for the autorange calculated on the x-axis, 5 should be included. ```python import plotly.express as px diff --git a/doc/python/box-plots.md b/doc/python/box-plots.md index a22762c0750..dbaca729096 100644 --- a/doc/python/box-plots.md +++ b/doc/python/box-plots.md @@ -458,12 +458,12 @@ x_data = ['Carmelo Anthony', 'Dwyane Wade', N = 50 -y0 = (10 * np.random.randn(N) + 30).astype(np.int) -y1 = (13 * np.random.randn(N) + 38).astype(np.int) -y2 = (11 * np.random.randn(N) + 33).astype(np.int) -y3 = (9 * np.random.randn(N) + 36).astype(np.int) -y4 = (15 * np.random.randn(N) + 31).astype(np.int) -y5 = (12 * np.random.randn(N) + 40).astype(np.int) +y0 = (10 * np.random.randn(N) + 30).astype(int) +y1 = (13 * np.random.randn(N) + 38).astype(int) +y2 = (11 * np.random.randn(N) + 33).astype(int) +y3 = (9 * np.random.randn(N) + 36).astype(int) +y4 = (15 * np.random.randn(N) + 31).astype(int) +y5 = (12 * np.random.randn(N) + 40).astype(int) y_data = [y0, y1, y2, y3, y4, y5] diff --git a/doc/python/icicle-charts.md b/doc/python/icicle-charts.md index 540f9f7e82c..dc7908a93bf 100644 --- a/doc/python/icicle-charts.md +++ b/doc/python/icicle-charts.md @@ -305,7 +305,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) + df_trees = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -317,11 +317,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_all_trees = df_all_trees.append(df_tree, ignore_index=True) + df_trees.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), - color=df[color_columns[0]].sum() / df[color_columns[1]].sum())) - df_all_trees = df_all_trees.append(total, ignore_index=True) + color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) + df_trees.append(total) + df_all_trees = pd.concat(df_trees, ignore_index=True) return df_all_trees diff --git a/doc/python/mixed-subplots.md b/doc/python/mixed-subplots.md index 13737b5f6d1..24ee5123beb 100644 --- a/doc/python/mixed-subplots.md +++ b/doc/python/mixed-subplots.md @@ -55,8 +55,8 @@ df = pd.read_csv( ) # frequency of Country -freq = df -freq = freq.Country.value_counts().reset_index().rename(columns={"index": "x"}) +freq = df['Country'].value_counts().reset_index() +freq.columns = ['x', 'Country'] # read in 3d volcano surface data df_v = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/volcano.csv") diff --git a/doc/python/ml-regression.md b/doc/python/ml-regression.md index b8be347943a..c74b49e92bd 100644 --- a/doc/python/ml-regression.md +++ b/doc/python/ml-regression.md @@ -120,7 +120,7 @@ from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split df = px.data.tips() -X = df.total_bill[:, None] +X = df.total_bill.to_numpy()[:, None] X_train, X_test, y_train, y_test = train_test_split(X, df.tip, random_state=0) model = LinearRegression() @@ -129,7 +129,6 @@ model.fit(X_train, y_train) x_range = np.linspace(X.min(), X.max(), 100) y_range = model.predict(x_range.reshape(-1, 1)) - fig = go.Figure([ go.Scatter(x=X_train.squeeze(), y=y_train, name='train', mode='markers'), go.Scatter(x=X_test.squeeze(), y=y_test, name='test', mode='markers'), diff --git a/doc/python/sunburst-charts.md b/doc/python/sunburst-charts.md index e22f9f9dd7b..e4ed65bc9b6 100644 --- a/doc/python/sunburst-charts.md +++ b/doc/python/sunburst-charts.md @@ -355,7 +355,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) + df_trees = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -367,11 +367,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_all_trees = df_all_trees.append(df_tree, ignore_index=True) + df_trees.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), - color=df[color_columns[0]].sum() / df[color_columns[1]].sum())) - df_all_trees = df_all_trees.append(total, ignore_index=True) + color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) + df_trees.append(total) + df_all_trees = pd.concat(df_trees, ignore_index=True) return df_all_trees diff --git a/doc/python/treemaps.md b/doc/python/treemaps.md index 98fbeadcd40..037240dff16 100644 --- a/doc/python/treemaps.md +++ b/doc/python/treemaps.md @@ -90,7 +90,7 @@ When the argument of `color` corresponds to non-numerical data, discrete colors ```python import plotly.express as px df = px.data.tips() -fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], +fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], values='total_bill', color='day') fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) fig.show() @@ -101,7 +101,7 @@ In the example below the color of Saturday and Sunday sectors is the same as Din ```python import plotly.express as px df = px.data.tips() -fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], +fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], values='total_bill', color='time') fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) fig.show() @@ -114,7 +114,7 @@ For more information about discrete colors, see the [dedicated page](/python/dis ```python import plotly.express as px df = px.data.tips() -fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], +fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], values='total_bill', color='time', color_discrete_map={'(?)':'lightgrey', 'Lunch':'gold', 'Dinner':'darkblue'}) fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) @@ -241,7 +241,7 @@ fig = go.Figure(go.Treemap( labels = labels, values = values, parents = parents, - marker_colors = ["pink", "royalblue", "lightgray", "purple", + marker_colors = ["pink", "royalblue", "lightgray", "purple", "cyan", "lightgray", "lightblue", "lightgreen"] )) @@ -316,7 +316,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) + df_trees = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -328,11 +328,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_all_trees = df_all_trees.append(df_tree, ignore_index=True) + df_trees.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), - color=df[color_columns[0]].sum() / df[color_columns[1]].sum())) - df_all_trees = df_all_trees.append(total, ignore_index=True) + color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) + df_trees.append(total) + df_all_trees = pd.concat(df_trees, ignore_index=True) return df_all_trees diff --git a/doc/requirements.txt b/doc/requirements.txt index 703ac8d2537..2f3f958d5ff 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -31,7 +31,7 @@ sphinx_bootstrap_theme recommonmark pathlib python-frontmatter -datashader==0.14.4 +datashader==0.16.1 pyarrow cufflinks==0.17.3 kaleido @@ -42,6 +42,5 @@ nbconvert==5.6.1 orjson dash-bio jinja2<3.1 -parmed<=3.4.4; python_version<"3.8" -dask==2022.2.0 +dask==2024.4.2 polars From b4aee4b1b01c57a656a924b07a8d5ea347a76e22 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 25 Apr 2024 18:40:11 -0400 Subject: [PATCH 09/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 2f3f958d5ff..9685150ba53 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -42,5 +42,5 @@ nbconvert==5.6.1 orjson dash-bio jinja2<3.1 -dask==2024.4.2 +dask==2023.12.1 polars From ee84681b35df034836c43fbafc54b4d3b15ec035 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Fri, 26 Apr 2024 09:58:44 -0400 Subject: [PATCH 10/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 9685150ba53..bf965190d42 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -42,5 +42,5 @@ nbconvert==5.6.1 orjson dash-bio jinja2<3.1 -dask==2023.12.1 +dask==2023.4.0 polars From 944a73aa82687595293fb567beb83b9176c94ed4 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Fri, 26 Apr 2024 10:16:54 -0400 Subject: [PATCH 11/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index bf965190d42..81c6b41d8f8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -42,5 +42,5 @@ nbconvert==5.6.1 orjson dash-bio jinja2<3.1 -dask==2023.4.0 +dask==2022.2.0 polars From 99e65518a6729f2976d66b648b7619605f8d9bc4 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Fri, 26 Apr 2024 10:35:17 -0400 Subject: [PATCH 12/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 81c6b41d8f8..828dae3c905 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -31,7 +31,7 @@ sphinx_bootstrap_theme recommonmark pathlib python-frontmatter -datashader==0.16.1 +datashader==0.14.4 pyarrow cufflinks==0.17.3 kaleido From b5f72fb5b6c2f26cedb036c547db5bec067105c2 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 1 May 2024 10:59:25 -0400 Subject: [PATCH 13/15] Update requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 828dae3c905..f216399c468 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -42,5 +42,5 @@ nbconvert==5.6.1 orjson dash-bio jinja2<3.1 -dask==2022.2.0 +dask==2024.4.2 polars From a0c4dcbd8aa35cba986e4dabdce89a15c6b8d227 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 1 May 2024 11:38:46 -0400 Subject: [PATCH 14/15] update datashader version add specific xarray version --- doc/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index f216399c468..a175baec1d8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -31,7 +31,7 @@ sphinx_bootstrap_theme recommonmark pathlib python-frontmatter -datashader==0.14.4 +datashader==0.16.1 pyarrow cufflinks==0.17.3 kaleido @@ -44,3 +44,4 @@ dash-bio jinja2<3.1 dask==2024.4.2 polars +xarray==2022.9.0 From b1888adeb4ec834a95b9410856cbebe1b2394f01 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 13 May 2024 09:57:32 -0400 Subject: [PATCH 15/15] make var name clearer --- doc/python/icicle-charts.md | 8 ++++---- doc/python/sunburst-charts.md | 8 ++++---- doc/python/treemaps.md | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/python/icicle-charts.md b/doc/python/icicle-charts.md index dc7908a93bf..38569a7ea03 100644 --- a/doc/python/icicle-charts.md +++ b/doc/python/icicle-charts.md @@ -305,7 +305,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_trees = [] + df_list = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -317,12 +317,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_trees.append(df_tree) + df_list.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) - df_trees.append(total) - df_all_trees = pd.concat(df_trees, ignore_index=True) + df_list.append(total) + df_all_trees = pd.concat(df_list, ignore_index=True) return df_all_trees diff --git a/doc/python/sunburst-charts.md b/doc/python/sunburst-charts.md index e4ed65bc9b6..06cfb38e57d 100644 --- a/doc/python/sunburst-charts.md +++ b/doc/python/sunburst-charts.md @@ -355,7 +355,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_trees = [] + df_list = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -367,12 +367,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_trees.append(df_tree) + df_list.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) - df_trees.append(total) - df_all_trees = pd.concat(df_trees, ignore_index=True) + df_list.append(total) + df_all_trees = pd.concat(df_list, ignore_index=True) return df_all_trees diff --git a/doc/python/treemaps.md b/doc/python/treemaps.md index 037240dff16..6671698cb93 100644 --- a/doc/python/treemaps.md +++ b/doc/python/treemaps.md @@ -316,7 +316,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): Levels are given starting from the bottom to the top of the hierarchy, ie the last level corresponds to the root. """ - df_trees = [] + df_list = [] for i, level in enumerate(levels): df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) dfg = df.groupby(levels[i:]).sum() @@ -328,12 +328,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): df_tree['parent'] = 'total' df_tree['value'] = dfg[value_column] df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] - df_trees.append(df_tree) + df_list.append(df_tree) total = pd.Series(dict(id='total', parent='', value=df[value_column].sum(), color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) - df_trees.append(total) - df_all_trees = pd.concat(df_trees, ignore_index=True) + df_list.append(total) + df_all_trees = pd.concat(df_list, ignore_index=True) return df_all_trees