I'm working in a python3 jupyter notebook.
I'm trying to do some numerical calculations on a column in my dataframe which is made up of dollar amounts. Some of the lines have "$- " instead of numbers. How do I tell python to ignore those rows so I can look at the valid data?
movie is my dataframe revenue is the column I'm looking at
set(movie['revenue'])
I get this type of output:
{' $- ',
'1',
'10',
'100',
'10000',
'97250400',
'98000000',
'99000000'}
I've tried a few ways so far:
movie['revenue'] = pd.to_numeric(movie['revenue'])
movie['revenue'] = movie['revenue'].astype(np.float64)
Nothing seems to work. Please help!