Python dataframe
operates on the specified column
Operates on a column and column
Modify the data type of a column
Modify the data type of the specified column
A certain column retains the specified decimal
The specified column retains the specified decimal
import pandas as pd
df = pd.DataFrame({
'v1':[1,2,3],
'v2':[1.111,2.222,3.333]
})
df
df = df.astype({
'v1':'float64'})
df
df.assign(v2=lambda df: round(df.v2,2))
df