Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by discuss.codecademy.com #
 
PREVIOUS NEXT
Tagged: #add #column #beginning #dataframe
ADD COMMENT
Topic
Name
1+4 =