Description
Code Sample, a copy-pastable example if possible
pd.Series([None, 42]).astype(str, skipna=True)
results in TypeError: astype() got an unexpected keyword argument 'skipna'
Problem description
The provided snippet used to work before the 1.0 release. With the skipna
argument, the None
was preserved as a real np.nan
type, instead of being converted to the string nan
. The skipna
argument seems to have gone in the 1.0 release and I can't find any way to restore this behavior without a custom function being passed to apply
.
Expected Output
A series with [np.nan, '42']
Output of pd.show_versions()
pandas : 1.0.0
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 19.3
setuptools : 44.0.0
Cython : None
pytest : 5.3.5
hypothesis : None
sphinx : 2.2.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.4.2
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.8.4 (dt dec pq3 ext lo64)
jinja2 : 2.11.1
IPython : 7.12.0
pandas_datareader: 0.8.1
bs4 : 4.8.2
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.4.2
matplotlib : 3.1.3
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : 5.3.5
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.13
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None