diff --git a/wafo/misc.py b/wafo/misc.py index cce43d8..484de8a 100644 --- a/wafo/misc.py +++ b/wafo/misc.py @@ -2916,7 +2916,7 @@ def _histogram(data, bins=None, range=None, normed=False, weights=None, """ x = np.atleast_1d(data) if bins is None: - bins = np.ceil(4 * np.sqrt(np.sqrt(len(x)))) + bins = int(np.ceil(4 * np.sqrt(np.sqrt(len(x))))) bin_, limits = np.histogram(data, bins=bins, range=range, normed=normed, weights=weights, density=density) xx, yy = _make_bars(limits, bin_) diff --git a/wafo/spectrum/core.py b/wafo/spectrum/core.py index 16e111b..b51d1ff 100644 --- a/wafo/spectrum/core.py +++ b/wafo/spectrum/core.py @@ -578,7 +578,7 @@ class SpecData1D(PlotData): if dt is None: return dt_old, 1 rate = max(round(dt_old * 1. / dt), 1.) - return dt, rate + return dt, int(rate) def _check_dt(self, dt): freq = self.args @@ -659,9 +659,9 @@ class SpecData1D(PlotData): n_f = len(freq) if nt is None: nt = rate * (n_f - 1) - else: # %check if Nt is ok + else: # check if Nt is ok nt = minimum(nt, rate * (n_f - 1)) - + # nr, nt = int(nr), int(nt) spec = self.copy() spec.resample(dt)