Skip to content

Commit

Permalink
fixes for pandas-dev#16155 and pandas-dev#16156 (need testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
ResidentMario committed Apr 27, 2017
1 parent 110ff7a commit a1a39e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3449,7 +3449,8 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
# if a singular fill value is provided, validate it
if value is not None:
# fill values by column, not all at once, to respect dtypes
if not isinstance(value, dict) and isinstance(self, ABCDataFrame):
if not isinstance(value, (dict, ABCSeries)) and \
isinstance(self, ABCDataFrame):
value = {col: value for col in self.columns}
try:
missing.validate_fill_value(self, value)
Expand Down Expand Up @@ -3544,7 +3545,7 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
obj = result[k]
obj.fillna(v, limit=limit, inplace=True,
downcast=downcast, errors=errors)
return result
return None if inplace else result
elif not is_list_like(value):
new_data = self._data.fillna(value=value, limit=limit,
inplace=inplace,
Expand Down

0 comments on commit a1a39e1

Please sign in to comment.