What does the na_rep parameter mean?

I am looking at cat () method

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.cat.html#pandas.Series.str.cat

I can't figure out what na_rep is.

+3
python pandas


source to share


1 answer


The docs Series.str.cat

says:

When na_rep is None (default behavior), NaN values ​​in the run are ignored.



Series(['a','b',np.nan,'c']).str.cat(sep=' ')  
'a b c'

Series(['a','b',np.nan,'c']).str.cat(sep=' ', na_rep='?')  
'a b ? c'

      

+3


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics