how to add a column to a dataframe in pandas certain position code example
Example: how to add the column to the beginning of dataframe
# Third position would be at index 2, because of zero-indexing.
df.insert(2, 'new-col', data)
# Third position would be at index 2, because of zero-indexing.
df.insert(2, 'new-col', data)