Skip to content

Commit

Permalink
pandas 0.23.0 change to types
Browse files Browse the repository at this point in the history
Added `from pandas.api import types`.

Changed from `common.is_numeric_dtype` and `common.is_datetime64_dtype` in lines 113 and 116 to `types.---` to make things work with pandas 0.23.0. 

Not sure if you use `from pandas.core import common` anywhere else in your code but quick test with it removed doesn't seem to break anything.

Didn't do extensive testing but does seem to get things working again.
  • Loading branch information
notauni authored May 20, 2018
1 parent 3a64a58 commit 2a05d97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas_summary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import pandas as pd
from pandas.core import common
from pandas.api import types


class DataFrameSummary(object):
Expand Down Expand Up @@ -109,10 +110,10 @@ def _get_columns_info(self, stats):
self.EXCLUDE,
column_info['constant'].union(column_info['bool']))
column_info[self.TYPE_NUMERIC] = pd.Index([c for c in rest_columns
if common.is_numeric_dtype(self.df[c])])
if types.is_numeric_dtype(self.df[c])])
rest_columns = self.get_columns(self.df[rest_columns], self.EXCLUDE, column_info['numeric'])
column_info[self.TYPE_DATE] = pd.Index([c for c in rest_columns
if common.is_datetime64_dtype(self.df[c])])
if types.is_datetime64_dtype(self.df[c])])
rest_columns = self.get_columns(self.df[rest_columns], self.EXCLUDE, column_info['date'])
unique_columns = stats['uniques'][rest_columns] == stats['counts'][rest_columns]
column_info[self.TYPE_UNIQUE] = stats['uniques'][rest_columns][unique_columns].index
Expand Down

0 comments on commit 2a05d97

Please sign in to comment.