python apply function to each column in dataframe code example
Example 1: pandas apply function to column
df['a'] = df['a'].apply(lambda x: x + 1)
Example 2: python pandas apply function to one column
df['a'] = df['a'].apply(lambda x: x + 1)
df['a'] = df['a'].apply(lambda x: x + 1)
df['a'] = df['a'].apply(lambda x: x + 1)