You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing a DataFrame with the dtype as str but not passing in any data (just an index), the resulting DataFrame is filled with the letter n:
In [61]: pd.DataFrame(index=range(2), columns=[0], dtype=str)
Out[61]:
00n1n
This is contrary to the behaviour of Series when no data is passed in:
In [62]: pd.Series(index=range(2), dtype=str)
Out[62]:
0NaN1NaNdtype: object
It would be logical for the DataFrame to be populated with NaN in this instance too.
The text was updated successfully, but these errors were encountered:
ajcr
changed the title
DataFrame filled with letter "n" when no data passed and dtype is specified as str
DataFrame populated with the letter "n" when no data passed and dtype is specified as str
Feb 6, 2015
This is discussed on Stack Overflow here.
When constructing a DataFrame with the
dtype
asstr
but not passing in any data (just an index), the resulting DataFrame is filled with the lettern
:This is contrary to the behaviour of Series when no data is passed in:
It would be logical for the DataFrame to be populated with
NaN
in this instance too.The text was updated successfully, but these errors were encountered: