import pandas as pd # Create a DataFrame df = pd.DataFrame({'A': [1, 2, 3, 4]}) # Create a column doubling the values of column A df['B'] = df['A'] * 2 # Apply lambda function to column A to create column C df['C'] = df['A'].apply(lambda x: x ** 2) # Print data frame print(df) >>> A B C 0 1 2 1 1 2 4 4 2 3 6 9 3 4 8 16