The above code drops the columns named ‘Age’ and ’Score’. ''' drop multiple column based on name''' ![]() Let’s see an example of how to drop multiple columns by name in python pandas So the resultant dataframe will beĭrop multiple columns based on column name in pandas In the above example column with the name ‘Age’ is deleted. In the above example column with index 3 is dropped(4 th column). ![]() Let’s see an example on dropping the column by its index in python pandas The above code drops the column named ‘Age’, the argument axis=1 denotes column, so the resultant dataframe will beĭrop single column in pandas by using column index Let’s see an example of how to drop a column by name in python pandas # drop a column based on name 'Scholarship':}ĭf = pd.DataFrame(d,columns=)ĭelete or drop column in pandas by column name using drop() function
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |