Skip to content

Commit f850b5d

Browse files
author
Nikolai Matiushev
committed
Workaround Series([]).sum() == NaN issue: pandas-dev/pandas#18678
1 parent 0e01e6a commit f850b5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pynorama/table/pandas_table.py

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def histogram_transform(pandas_table, transform):
122122
counts = series.value_counts()
123123
cut = counts.iloc[0:bins]
124124
cut['Other'] = counts[bins:].sum()
125+
# FIXME: Workaround for https://github.com/pandas-dev/pandas/issues/18678
126+
if np.isnan(cut['Other']):
127+
cut['Other'] = 0
125128
x = cut.index.tolist()
126129
y = cut.values.tolist()
127130
# FIXME: Is this the right width for categorical variables? Perhaps a list of 1-s?

0 commit comments

Comments
 (0)