Skip to content

Commit 9c38b01

Browse files
committed
Remove deprecated numpy types in sources
1 parent e75fbca commit 9c38b01

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Diff for: packages/python/plotly/plotly/express/imshow_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
_integer_ranges = {t: (np.iinfo(t).min, np.iinfo(t).max) for t in _integer_types}
2222
dtype_range = {
2323
np.bool_: (False, True),
24-
np.bool8: (False, True),
2524
np.float16: (-1, 1),
2625
np.float32: (-1, 1),
2726
np.float64: (-1, 1),

Diff for: packages/python/plotly/plotly/figure_factory/_streamline.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ def value_at(self, a, xi, yi):
180180
Set up for RK4 function, based on Bokeh's streamline code
181181
"""
182182
if isinstance(xi, np.ndarray):
183-
self.x = xi.astype(np.int)
184-
self.y = yi.astype(np.int)
183+
self.x = xi.astype(int)
184+
self.y = yi.astype(int)
185185
else:
186-
self.val_x = np.int(xi)
187-
self.val_y = np.int(yi)
186+
self.val_x = int(xi)
187+
self.val_y = int(yi)
188188
a00 = a[self.val_y, self.val_x]
189189
a01 = a[self.val_y, self.val_x + 1]
190190
a10 = a[self.val_y + 1, self.val_x]

Diff for: packages/python/plotly/plotly/figure_factory/_violin.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def calc_stats(data):
1616
"""
1717
Calculate statistics for use in violin plot.
1818
"""
19-
x = np.asarray(data, np.float)
19+
x = np.asarray(data, float)
2020
vals_min = np.min(x)
2121
vals_max = np.max(x)
2222
q2 = np.percentile(x, 50, interpolation="linear")
@@ -160,7 +160,7 @@ def violinplot(vals, fillcolor="#1f77b4", rugplot=True):
160160
"""
161161
Refer to FigureFactory.create_violin() for docstring.
162162
"""
163-
vals = np.asarray(vals, np.float)
163+
vals = np.asarray(vals, float)
164164
# summary statistics
165165
vals_min = calc_stats(vals)["min"]
166166
vals_max = calc_stats(vals)["max"]
@@ -231,7 +231,7 @@ def violin_no_colorscale(
231231
)
232232
color_index = 0
233233
for k, gr in enumerate(group_name):
234-
vals = np.asarray(gb.get_group(gr)[data_header], np.float)
234+
vals = np.asarray(gb.get_group(gr)[data_header], float)
235235
if color_index >= len(colors):
236236
color_index = 0
237237
plot_data, plot_xrange = violinplot(
@@ -319,7 +319,7 @@ def violin_colorscale(
319319
min_value = min(group_stats_values)
320320

321321
for k, gr in enumerate(group_name):
322-
vals = np.asarray(gb.get_group(gr)[data_header], np.float)
322+
vals = np.asarray(gb.get_group(gr)[data_header], float)
323323

324324
# find intermediate color from colorscale
325325
intermed = (group_stats[gr] - min_value) / (max_value - min_value)
@@ -411,7 +411,7 @@ def violin_dict(
411411
)
412412

413413
for k, gr in enumerate(group_name):
414-
vals = np.asarray(gb.get_group(gr)[data_header], np.float)
414+
vals = np.asarray(gb.get_group(gr)[data_header], float)
415415
plot_data, plot_xrange = violinplot(vals, fillcolor=colors[gr], rugplot=rugplot)
416416
layout = graph_objs.Layout()
417417

0 commit comments

Comments
 (0)