Skip to content

Commit 66e2535

Browse files
author
Michael Erickson
committed
Cooperating with linter
1 parent dc580df commit 66e2535

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

swat/cas/table.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3356,19 +3356,21 @@ def _nunique(self, skipna=True):
33563356
:class:`swat.CASResults`
33573357
If By groups are specified.
33583358
'''
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
33603360
if self.get_groupby_vars():
3361-
#Just return the CASResults object
3361+
# Just return the CASResults object
33623362
return self._retrieve('simple.distinct', includeMissing=not skipna)
33633363
else:
3364-
distinct_table = self._retrieve('simple.distinct', includeMissing=not skipna)['Distinct']
3364+
distinct_table = self._retrieve('simple.distinct',
3365+
includeMissing=not skipna)['Distinct']
33653366
# 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')
33673369
# 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
33703372

3371-
return distinct_table
3373+
return distinct_series
33723374

33733375
# def isin(self, values, casout=None):
33743376
# raise NotImplementedError

swat/tests/cas/test_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3269,7 +3269,7 @@ def test_nunique(self):
32693269
for col in tbl.columns:
32703270
self.assertEquals(tbl_nunique[col], df_nunique[col])
32713271

3272-
#Now counting NaN
3272+
# Now counting NaN
32733273
tbl_nunique_nan = tbl.nunique(dropna=False)
32743274
df_nunique_nan = df.nunique(dropna=False)
32753275
# Length of Series are equal

0 commit comments

Comments
 (0)