Can't drop a certain row in Pandas

Question:

note that title is index.

title rating rat_count
‘Til There Was You 2.333333 9
1-900 2.600000 5
101 Dalmatians 2.908257 109
12 Angry Men 4.344000 125
Young Guns 3.207921 101

I tried

i = movies[movies['rating']==3.4444].index
movies.drop(i)
# This one has no effect and didn't removed

2:

movies.drop(0)

3:

movies.drop(movies.iloc[0])

error of 3:

KeyError: '[3.4444444444444446, 9.0] not found in axis'

4:

movies.drop(' ')

error of 4:

KeyError: "[' '] not found in axis"

5:

movies.drop(' ',axis=0)

error of 5:

KeyError: "[' '] not found in axis"

I want to drop the first row, which has no title(or a blank) with 3.44 rating and 9 rat_count.

Asked By: acsolak34

||

Answers:

movies.drop(movies.index[0])

solved the problem.

Answered By: acsolak34
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.