Skip to content

Commit 3be6872

Browse files
committed
CLN: use ndarray.reshape(shape) instead of .reshape(*shape)
it is sometimes better supported by numpy-like implementations
1 parent 5f045fe commit 3be6872

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

larray/core/array.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ def to_frame(self, fold_last_axis_name=False, dropna=None):
14541454
index = pd.Index([''])
14551455
if fold_last_axis_name:
14561456
index.name = self.axes.names[-1]
1457-
data = np.asarray(self).reshape(len(index), len(columns))
1457+
data = np.asarray(self).reshape((len(index), len(columns)))
14581458
df = pd.DataFrame(data, index, columns)
14591459
if dropna is not None:
14601460
dropna = dropna if dropna is not True else 'all'
@@ -2669,7 +2669,7 @@ def dump(self, header=True, wide=True, value_name='value', light=False, axes_nam
26692669
# array is not of object dtype (the usual case).
26702670

26712671
# flatten all dimensions except the last one
2672-
res2d = ensure_no_numpy_type(self.data.reshape(-1, self.shape[-1]))
2672+
res2d = ensure_no_numpy_type(self.data.reshape((-1, self.shape[-1])))
26732673
else:
26742674
if not self.ndim:
26752675
return None
@@ -2680,7 +2680,7 @@ def dump(self, header=True, wide=True, value_name='value', light=False, axes_nam
26802680
else:
26812681
width = 1
26822682
height = int(np.prod(self.shape))
2683-
data = self.data.reshape(height, width)
2683+
data = self.data.reshape((height, width))
26842684

26852685
# get list of names of axes
26862686
if _axes_display_names:

0 commit comments

Comments
 (0)