diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py index 7024b3a130f..74c2aadaf43 100644 --- a/modin/data_management/data_manager.py +++ b/modin/data_management/data_manager.py @@ -750,26 +750,6 @@ def idxmin_builder(df, **kwargs): # have to do a conversion. return self._post_process_idx_ops(axis, min_result) - def info(self, **kwargs): - def info_builder(df, **kwargs): - result = pandas.DataFrame() - if memory_usage: - result['memory'] = df.memory_usage(index=False, deep=memory_usage_deep) - if null_counts: - result['count'] = df.count(axis=0) - return result - - memory_usage = kwargs.get('memory_usage', True) - null_counts = kwargs.get('null_counts', True) - - if type(memory_usage) == str and memory_usage == 'deep': - memory_usage_deep = True - else: - memory_usage_deep = False - - func = self._prepare_method(info_builder, **kwargs) - return self.full_axis_reduce(func, 0) - def last_valid_index(self): def last_valid_index_builder(df): diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py index 839dc21c0b9..4b85bb62a66 100644 --- a/modin/pandas/dataframe.py +++ b/modin/pandas/dataframe.py @@ -1724,22 +1724,10 @@ def info(self, # Create the Index info() string by parsing self.index index_string = index.summary() + '\n' - if memory_usage or null_counts: - results_data = self._data_manager.info( - verbose=actually_verbose, - buf=buf, - max_cols=max_cols, - memory_usage=memory_usage, - null_counts=null_counts - ) - if null_counts: - # For some reason, the counts table has a shape of (columns, columns) - counts = results_data['count'] - counts.columns = columns - if memory_usage: - # For some reason, the memory table has a shape of (columns, columns) - # but it doesn't matter because the cells not on the diagonal are NaN - memory_usage_data = results_data['memory'].sum() + index.memory_usage(deep=memory_usage_deep) + if null_counts: + counts = self._data_manager.count() + if memory_usage: + memory_usage_data = self._data_manager.memory_usage(deep=memory_usage_deep, index=True) if actually_verbose: # Create string for verbose output @@ -1748,7 +1736,7 @@ def info(self, for col, dtype in zip(columns, dtypes): col_string += '{0}\t'.format(col) if null_counts: - col_string += '{0} not-null '.format(counts.loc[col, col]) + col_string += '{0} not-null '.format(counts[col]) col_string += '{0}\n'.format(dtype) else: # Create string for not verbose output