Ebay Car Sales Data - need help

I’m stuck with my guided project.
When using the df.drop() function, can we drop the whole row using the index name?
First, I named the index, then tried to use that name to drop the row. But it keeps saying my index name is not defined.

Referring to ln [129]

Screen Shot 2020-12-30 at 1.17.52 PM

Ebay Car Sales Data .ipynb (114.1 KB)

Click here to view the jupyter notebook file in a new tab

1 Like

There is no variable name index_0to5 in notebook. You are using undefined variable.

You can also read in doc about NameError exception

Alternatively, you can select and reassign those values between 5 and whatever max price you want, back to autos which will give you the same results .

price_0to5_bool.index.name = 'index_0to5'

if I do this, doesn’t it mean I assigned the variable name as ‘index_0to5’?


Here you are giving label to the index of data frame.