Guided Project: Exploring Ebay Car Sales Data;4. Exploring the Odometer and Price Columns

sales =autos["dollar_price"].value_counts().sort_index()
print(sales)

output:

0           1421
1            156
2              3
3              1
5              2
            ... 
10000000       1
11111111       2
12345678       3
27322222       1
99999999       1
Name: dollar_price, Length: 2357, dtype: int64
autos["dollar_price"]=autos[autos["dollar_price"].between(2,10000000)]
print(sales)

output:

0           1421
1            156
2              3
3              1
5              2
            ... 
10000000       1
11111111       2
12345678       3
27322222       1
99999999       1
Name: dollar_price, Length: 2357, dtype: int64

so my problem, is that i can’t figure out why i am not removing the unwanted values below 1, and above 10,000,000

Hi @westlundderek
You can try to run this code again

before you print(sales)

2016-03-05 14:06:30    1
2016-03-05 14:06:40    1
2016-03-05 14:07:04    1
2016-03-05 14:07:08    1
2016-03-05 14:07:21    1
                      ..
2016-04-07 14:30:09    1
2016-04-07 14:30:26    1
2016-04-07 14:36:44    1
2016-04-07 14:36:55    1
2016-04-07 14:36:56    1
Name: dollar_price, Length: 46746, dtype: int64

running ‘sales =autos[“dollar_price”].value_counts().sort_index()’ before printing sales again, now outputs the dates

Hi @westlundderek
in this code, you assign all the columns to the price column

maybe you should try this

autos =autos[autos["dollar_price"].between(2,10000000)]
1 Like

that worked. thanks.

1 Like