Skip to main content
deleted 59 characters in body
Source Link

Deleting a column using the iloc function of dataframe and slicing, when we have a typical column name with unwanted values:

df = df.iloc[:,1:] # Removing an unnamed index column 

Here 0 is the default row and 1 is the first column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.

Deleting a column using the iloc function of dataframe and slicing, when we have a typical column name with unwanted values:

df = df.iloc[:,1:] # Removing an unnamed index column 

Here 0 is the default row and 1 is the first column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.

Deleting a column using the iloc function of dataframe and slicing, when we have a typical column name with unwanted values:

df = df.iloc[:,1:] # Removing an unnamed index column 

Here 0 is the default row and 1 is the first column, hence :,1: is our parameter for deleting the first column.

Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Deleting a column using the iloc function of dataframe and slicing, when we have a typical column name with unwanted values.:

df = df.iloc[:,1:] # removingRemoving an unnamed index column 

Here 0 is the default row and 1 is 1stthe first column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.

Deleting a column using iloc function of dataframe and slicing, when we have a typical column name with unwanted values.

df = df.iloc[:,1:] # removing an unnamed index column 

Here 0 is the default row and 1 is 1st column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.

Deleting a column using the iloc function of dataframe and slicing, when we have a typical column name with unwanted values:

df = df.iloc[:,1:] # Removing an unnamed index column 

Here 0 is the default row and 1 is the first column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.

Source Link

Deleting a column using iloc function of dataframe and slicing, when we have a typical column name with unwanted values.

df = df.iloc[:,1:] # removing an unnamed index column 

Here 0 is the default row and 1 is 1st column so ,1 where starts and stepping is taking default values, hence :,1: is our parameter for deleting the first column.