As it may have been common sense for those who know it, the argument of .astype ()
can be specified in a dictionary.
from numpy.random import rand
from pandas import DataFrame
df = DataFrame(rand(3, 3), columns=[list('abc')])
df.dtypes
a float64
b float64
c float64
dtype: object
print(df.astype({'a': int, 'c': str}))
a b c
0 0 0.692601 0.0963216888725
1 0 0.873724 0.00960078591002
2 0 0.536855 0.639548536613
print(df.astype({'a': int, 'c': str}).dtypes)
a int64
b float64
c object
dtype: object