Data wrangling

Delete Column in Pandas DataFrame

Use drop() function from Pandas package to delete column in DataFrame. You can drop single column or multiple columns at once. The drop operation is performed inplace.

delete-columnpandas

Required packages

You need below packages to use the code generated by recipe. All packages are automatically installed in MLJAR Studio.

pandas>=1.0.0

Interactive recipe

You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.

In the below recipe, we assume that you have following variables available in your notebook:

  • df (type DataFrame)

Python code

# Python code will be here

Code explanation

Select column or list of columns and delete them from the DataFrame.

« Previous
Filter rows