From e69ba4b53bebf1695321e2d784b487c81b0fe3a8 Mon Sep 17 00:00:00 2001 From: homosapien-lcy <102019577+homosapien-lcy@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:57:56 +0900 Subject: [PATCH] MAINT: replace deprecated boston dataset with diabetes in chaco examples (#870) Co-authored-by: Chengyu Liu --- .../plot_types/create_plot_snapshots.py | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/user_guide/plot_types/create_plot_snapshots.py b/examples/user_guide/plot_types/create_plot_snapshots.py index 1fc98bbfa..eb11580ea 100644 --- a/examples/user_guide/plot_types/create_plot_snapshots.py +++ b/examples/user_guide/plot_types/create_plot_snapshots.py @@ -149,9 +149,9 @@ def get_line_plot(render_style): def get_scatter_plot(): - boston = datasets.load_boston() - prices = boston["target"] - lower_status = boston["data"][:, -1] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] + lower_status = diabetes["data"][:, -1] x, y = get_data_sources(x=lower_status, y=prices) x_mapper, y_mapper = get_mappers(x, y) @@ -176,10 +176,10 @@ def get_scatter_plot(): def get_cmap_scatter_plot(): - boston = datasets.load_boston() - prices = boston["target"] - lower_status = boston["data"][:, -1] - nox = boston["data"][:, 4] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] + lower_status = diabetes["data"][:, -1] + nox = diabetes["data"][:, 4] x, y = get_data_sources(x=lower_status, y=prices) x_mapper, y_mapper = get_mappers(x, y) @@ -212,11 +212,11 @@ def get_cmap_scatter_plot(): def get_4d_scatter_plot(): - boston = datasets.load_boston() - prices = boston["target"] - lower_status = boston["data"][:, -1] - tax = boston["data"][:, 9] - nox = boston["data"][:, 4] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] + lower_status = diabetes["data"][:, -1] + tax = diabetes["data"][:, 9] + nox = diabetes["data"][:, 4] x, y = get_data_sources(x=lower_status, y=prices) x_mapper, y_mapper = get_mappers(x, y) @@ -255,10 +255,10 @@ def get_4d_scatter_plot(): def get_variable_size_scatter_plot(): - boston = datasets.load_boston() - prices = boston["target"] - lower_status = boston["data"][:, -1] - tax = boston["data"][:, 9] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] + lower_status = diabetes["data"][:, -1] + tax = diabetes["data"][:, 9] x, y = get_data_sources(x=lower_status, y=prices) x_mapper, y_mapper = get_mappers(x, y) @@ -288,8 +288,8 @@ def get_variable_size_scatter_plot(): def get_jitter_plot(): - boston = datasets.load_boston() - prices = boston["target"] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] x, y = get_data_sources(y=prices) x_mapper, y_mapper = get_mappers(x, y) @@ -566,8 +566,8 @@ def get_polygon_plot(): def get_bar_plot(): - boston = datasets.load_boston() - prices = boston["target"] + diabetes = datasets.load_diabetes() + prices = diabetes["target"] ys, bin_edges = np.histogram(prices, bins=10) ys = ys.astype("d") / ys.sum()