1

axis refers to the dimension of the array, in the case of pd.DataFrames axis=0 is the dimension that points downwards (column) and axis=1 the one that points to the right(row)

However, while dropping a column we are supposed to write the code as

df = df.drop("BuildingArea", axis = 1)

instead of

df = df.drop("BuildingArea", axis = 0)

Why is that so ? This is counter-intuitive.

PKumar
  • 10,971
  • 6
  • 37
  • 52
Vikas
  • 61
  • 1
  • 5

0 Answers0