Skip to content

Commit 127422f

Browse files
committed
COMPAT: remove deprecation warnings for numpy 1.14
COMPAT: sas7bdat warning of unclosed file with 0 rows
1 parent 9e3ad63 commit 127422f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pandas/core/groupby.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,10 @@ def size(self):
19131913
"""
19141914
ids, _, ngroup = self.group_info
19151915
ids = _ensure_platform_int(ids)
1916-
out = np.bincount(ids[ids != -1], minlength=ngroup or None)
1916+
if ngroup:
1917+
out = np.bincount(ids[ids != -1], minlength=ngroup)
1918+
else:
1919+
out = ids
19171920
return Series(out,
19181921
index=self.result_index,
19191922
dtype='int64')

pandas/io/sas/sas7bdat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ def read(self, nrows=None):
596596
nrows = self.row_count
597597

598598
if len(self.column_types) == 0:
599+
self.close()
599600
raise EmptyDataError("No columns to parse from file")
600601

601602
if self._current_row_in_file_index >= self.row_count:

0 commit comments

Comments
 (0)