3 ms·
There are always choices to make. In this case, I would much prefer to let the data be treated as is, i.e., no silent casting of np.nan to the string "nan". Whe
by geoalchimista 7y ago
There are always choices to make. In this case, I would much prefer to let the data be treated as is, i.e., no silent casting of np.nan to the string "nan". When dealing with numerical data, a string "nan" is rarely useful. But when you need it, you can still create a data series with a string "nan" using
pd.Series([str(np.nan), "a"])
- nl 7y agoSo you want the behavior that Pandas has (i.e., no silent casting of np.nan to the string "nan").
- geoalchimista 7y agoThe point I wanted to make was that string "nan" is usually not as useful as floating point NaN when dealing with numerical data. Therefore, as default behavior it is acceptable, if one has to make a choice.