@@ -3356,19 +3356,21 @@ def _nunique(self, skipna=True):
3356
3356
:class:`swat.CASResults`
3357
3357
If By groups are specified.
3358
3358
'''
3359
- #If we have a groupby table, we will have multiple tables in our CASResults
3359
+ # If we have a groupby table, we will have multiple tables in our CASResults
3360
3360
if self .get_groupby_vars ():
3361
- #Just return the CASResults object
3361
+ # Just return the CASResults object
3362
3362
return self ._retrieve ('simple.distinct' , includeMissing = not skipna )
3363
3363
else :
3364
- distinct_table = self ._retrieve ('simple.distinct' , includeMissing = not skipna )['Distinct' ]
3364
+ distinct_table = self ._retrieve ('simple.distinct' ,
3365
+ includeMissing = not skipna )['Distinct' ]
3365
3366
# Reduce table to a Series based off the NDistinct column
3366
- distinct_table = distinct_table .set_index ('Column' ).loc [:,'NDistinct' ].astype ('int64' )
3367
+ distinct_table = distinct_table .set_index ('Column' )
3368
+ distinct_series = distinct_table .loc [:, 'NDistinct' ].astype ('int64' )
3367
3369
# Strip names from Series to match pandas nunique
3368
- distinct_table .index .name = None
3369
- distinct_table .name = None
3370
+ distinct_series .index .name = None
3371
+ distinct_series .name = None
3370
3372
3371
- return distinct_table
3373
+ return distinct_series
3372
3374
3373
3375
# def isin(self, values, casout=None):
3374
3376
# raise NotImplementedError
0 commit comments