@@ -3334,9 +3334,9 @@ def nunique(self, dropna=True, casout=None):
3334
3334
3335
3335
Returns
3336
3336
-------
3337
- int
3337
+ :class:`pandas.Series`
3338
3338
If no By groups are specified.
3339
- :class:`pandas .Series `
3339
+ :class:`swat.CASResults `
3340
3340
If By groups are specified.
3341
3341
3342
3342
'''
@@ -3351,11 +3351,14 @@ def _nunique(self, skipna=True):
3351
3351
3352
3352
Returns
3353
3353
-------
3354
- :class:`pandas .Series`
3354
+ :class:`pandas.Series`
3355
+ If By groups are not specified.
3356
+ :class:`swat.CASResults`
3355
3357
If By groups are specified.
3356
3358
'''
3357
- #If we have a groupby table, we need to consider that
3359
+ #If we have a groupby table, we will have multiple tables in our CASResults
3358
3360
if self .get_groupby_vars ():
3361
+ #Just return the CASResults object
3359
3362
return self ._retrieve ('simple.distinct' , includeMissing = not skipna )
3360
3363
else :
3361
3364
distinct_table = self ._retrieve ('simple.distinct' , includeMissing = not skipna )['Distinct' ]
@@ -3365,7 +3368,7 @@ def _nunique(self, skipna=True):
3365
3368
distinct_table .index .name = None
3366
3369
distinct_table .name = None
3367
3370
3368
- return distinct_table
3371
+ return distinct_table
3369
3372
3370
3373
# def isin(self, values, casout=None):
3371
3374
# raise NotImplementedError
0 commit comments