diff --git a/doc/source/whatsnew/v0.19.2.txt b/doc/source/whatsnew/v0.19.2.txt index 722e494c9e614..bf52d1a74e3ea 100644 --- a/doc/source/whatsnew/v0.19.2.txt +++ b/doc/source/whatsnew/v0.19.2.txt @@ -80,3 +80,4 @@ Bug Fixes - Explicit check in ``to_stata`` and ``StataWriter`` for out-of-range values when writing doubles (:issue:`14618`) - Bug in ``.plot(kind='kde')`` which did not drop missing values to generate the KDE Plot, instead generating an empty plot. (:issue:`14821`) - Bug in ``unstack()`` if called with a list of column(s) as an argument, regardless of the dtypes of all columns, they get coerced to ``object`` (:issue:`11847`) +- Fix bug (:issue:`15265`) in ``cartesian_product`` in ``pandas.tools.util`` that caused an uncaught overflow error when using large arguments. diff --git a/pandas/tools/util.py b/pandas/tools/util.py index b50bf9dc448bc..5cdb81a0098d8 100644 --- a/pandas/tools/util.py +++ b/pandas/tools/util.py @@ -55,7 +55,7 @@ def cartesian_product(X): if len(X) == 0: return [] - lenX = np.fromiter((len(x) for x in X), dtype=int) + lenX = np.fromiter((len(x) for x in X), dtype=np.intp) cumprodX = np.cumproduct(lenX) a = np.roll(cumprodX, 1)