how to add column to dataframe to front code example
Example 1: 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)
Example 2: add column to start of dataframe pandas
df.insert(loc, column, value)