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