Skip to content

BUG/CLN: fillna with string-like raises #5136

Closed
@jreback

Description

@jreback

The fillna should work with this type of replacement (could just directly call replace if method=None in fact).

In [1]: df = DataFrame(dict(A = [1,np.nan]))

In [2]: df
Out[2]: 
    A
0   1
1 NaN

In [3]: df.fillna('')
ValueError: could not convert string to float: 

In [4]: df.replace(np.nan,'')
Out[4]: 
   A
0  1
1   

http://stackoverflow.com/questions/19215383/how-to-not-display-nan-in-ipython-notebook-html-table-of-pandas-dataframe

Metadata

Metadata

Assignees

Labels

Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateRefactorInternal refactoring of code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions