Source Code:
(back to article)
import pandas as pd # create a sample dataframe df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) # add an empty column named 'C' df = df.assign(C=None) print(df)
Result:
Report an issue