Skip to content

Commit 8bb46eb

Browse files
committed
edit scipy protected import
1 parent d88e0f2 commit 8bb46eb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plotly/tools.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def warning_on_one_line(message, category, filename, lineno,
5252
_numpy_imported = False
5353

5454
try:
55+
import scipy
5556
from scipy.stats import norm, gaussian_kde
5657
_scipy_imported = True
5758
except ImportError:
@@ -2350,7 +2351,7 @@ def create_distplot(hist_data, group_labels,
23502351
import plotly.plotly as py
23512352
from plotly.tools import FigureFactory as FF
23522353
2353-
from scipy.stats import norm, gaussian_kde
2354+
23542355
23552356
hist_x = [[1.1, 1.1, 2.5, 3.0, 3.5,
23562357
3.5, 4.1, 4.4, 4.5, 4.5,
@@ -2369,8 +2370,6 @@ def create_distplot(hist_data, group_labels,
23692370
import plotly.plotly as py
23702371
from plotly.tools import FigureFactory as FF
23712372
2372-
from scipy.stats import norm, gaussian_kde
2373-
23742373
# Add histogram data
23752374
hist1_x = [0.8, 1.2, 0.2, 0.6, 1.6,
23762375
-0.9, -0.07, 1.95, 0.9, -0.2,
@@ -2404,8 +2403,6 @@ def create_distplot(hist_data, group_labels,
24042403
import plotly.plotly as py
24052404
from plotly.tools import FigureFactory as FF
24062405
2407-
from scipy.stats import norm, gaussian_kde
2408-
24092406
x1 = np.random.randn(20)
24102407
x2 = np.random.randn(40)+1
24112408
x3 = np.random.randn(10)-1

0 commit comments

Comments
 (0)