Skip to content

Commit db9af36

Browse files
committed
Pass ndim
1 parent 50de326 commit db9af36

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/core/internals/blocks.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -662,16 +662,14 @@ def _astype(self, dtype, copy=False, errors='raise', values=None,
662662
pass
663663

664664
newb = make_block(values, placement=self.mgr_locs,
665-
klass=klass)
665+
klass=klass, ndim=self.ndim)
666666
except:
667667
if errors == 'raise':
668668
raise
669669
newb = self.copy() if copy else self
670670

671671
if newb.is_numeric and self.is_numeric:
672-
# use values.shape, rather than newb.shape, as newb.shape
673-
# may be incorrect for ExtensionBlocks.
674-
if values.shape != self.shape:
672+
if newb.shape != self.shape:
675673
raise TypeError(
676674
"cannot set astype for copy = [{copy}] for dtype "
677675
"({dtype} [{itemsize}]) with smaller itemsize than "

0 commit comments

Comments
 (0)