benmiroglio / pymatch

MIT License
272 stars 128 forks source link

Float and Int - Treated as Categorical? #31

Closed Jentwisle closed 4 years ago

Jentwisle commented 4 years ago

I am trying to use this package on a dataset that contains both categorical featuresand numerical features. For some reason when I run the below it returns all features as if it is treating them all as categorical.

categorical_results = m.compare_categorical(return_table=True)

Running the below returns an error which I assume means I don't have any continous features:

cc = m.compare_continuous(return_table=True)

KeyError: "['var' 'ks_before' 'ks_after' 'grouped_chisqr_before'\n 'grouped_chisqr_after' 'std_median_diff_before' 'std_median_diff_after'\n 'std_mean_diff_before' 'std_mean_diff_after'] not in index"

I haven't used this package in a while, but I had no issues with this in the past. Anyone run into this? I've checked my dataframe columns throughout each step and they appear to remain of dtype 'int64' or 'float64'. Checking the generated dataframe columns from 'matched_data' shows the same dtypes also.

Jentwisle commented 4 years ago

Apologies. Going through the code it appears there was an update to address this that I did not have. It appears to be working now.