Column filter and average calculation

Asked

Viewed 37 times

-2

good afternoon I am studying a datasets and need to find out the average price of houses with 2 bathrooms?

I used the code: print(data["bathrooms","price"]]. groupby("bathrooms"). Mean())inserir a descrição da imagem aqui

Note: I am totally layman, thank you

1 answer

0

That should work
data['price'][data.bathrooms == 2]. Mean()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.