Skip to content

Commit 538d281

Browse files
committed
squash a couple of errors
1 parent bda3ab1 commit 538d281

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/core/generic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3446,8 +3446,9 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
34463446
limit=None, downcast=None, errors=None):
34473447
inplace = validate_bool_kwarg(inplace, 'inplace')
34483448

3449-
if value:
3450-
# fill values by column, not all at once, to respect dtypes.
3449+
# if a singular fill value is provided, validate it
3450+
if value is not None:
3451+
# fill values by column, not all at once, to respect dtypes
34513452
if not isinstance(value, dict) and isinstance(self, ABCDataFrame):
34523453
value = {col: value for col in self.columns}
34533454
try:

pandas/core/internals.py

+3
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ def fillna(self, value, limit=None, inplace=False, downcast=None,
366366
""" fillna on the block with the value. If we fail, then convert to
367367
ObjectBlock and try again
368368
"""
369+
if not errors:
370+
errors = 'coerce'
371+
369372
inplace = validate_bool_kwarg(inplace, 'inplace')
370373

371374
if not self._can_hold_na:

0 commit comments

Comments
 (0)