diff --git a/modin/engines/base/frame/data.py b/modin/engines/base/frame/data.py index f86090fc757..bfce32cfe6e 100644 --- a/modin/engines/base/frame/data.py +++ b/modin/engines/base/frame/data.py @@ -544,15 +544,11 @@ def _get_dict_of_block_index(self, axis, indices, ordered=False): else: indices = np.array(indices) if not axis: - # INT_MAX to make sure we don't try to compute on partitions that don't - # exist. - cumulative = np.array( - np.append(self._column_widths[:-1], np.iinfo(np.int32).max) - ).cumsum() + bins = np.array(self._column_widths) else: - cumulative = np.array( - np.append(self._row_lengths[:-1], np.iinfo(np.int32).max) - ).cumsum() + bins = np.array(self._row_lengths) + # INT_MAX to make sure we don't try to compute on partitions that don't exist. + cumulative = np.append(bins[:-1].cumsum(), np.iinfo(bins.dtype).max) def internal(block_idx, global_index): return (