Don't understand 'Divide by zero encountered in doube_scalars'

Link to DQ mission:
https://app.dataquest.io/m/309/z-scores/4/locating-values-in-different-distributions

First-time poster, I hope the formatting is the way it supposed to be.

I am trying to find which neighborhood has a z-score closest to zero based on a SalesPrice of USD 200,000. Rather than specifically specifying which neighborhoods I’m interested in, I thought I could iterate through the column’s unique values.

z_by_location = {}

for n in houses['Neighborhood'].unique():
    neighborhood = houses[houses['Neighborhood'] == n]
    z_by_location[n] = z_score(200000, neighborhood['SalePrice'])
    
print(z_by_location)

It isn’t working as planned as I get the following error message:

/dataquest/system/env/python3/bin/ipython:8: RuntimeWarning:

divide by zero encountered in double_scalars

I understand there are many ways to code what I’m trying to find, but I’d like to understand how exactly my code isn’t working as I had hoped. Any help would be much appreciated!

Hello @josh_carlson, Welcome to the DataQuest Community!.

Unfortunately I have not done that mission yet, it would be better for you to provide link to the mission for assistance.

Hey @josh_carlson

This is not actually error, but warnings. They are there because you are trying to divide something by zero.

As per my understanding i am not able to figure out the issue by looking at your code. May be if you provide some more details so that i’ll try my best to help you.

Best
K!

Sorry about that, I’ve edited my post to include the mission link at the top