We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Currently pd.DataFrame.astype only allows for one type.
pd.DataFrame.astype
I would like it to support a dict mapping column names to dtypes. Like for example the dtype argument of pd.read_json.
dict
dtype
pd.read_json
df = pd.DataFrame({'a': [1, 2, 3], 'b': [1, 2, 3]}) df = df.astype({'a': 'int16', 'b': 'float32'})