Learn About the Mode and When to Use It — Special Cases | Dataquest

PHOTO EMBED

Wed Jul 26 2023 02:32:05 GMT+0000 (Coordinated Universal Time)

Saved by @vikas180

intervals = pd.interval_range(start = 0, end = 800000, freq = 100000)

gr_freq_table = pd.Series([0,0,0,0,0,0,0,0], index = intervals)

for value in houses['SalePrice']:
    for interval in intervals:
        if value in interval:
            gr_freq_table.loc[interval] += 1
            break

print(gr_freq_table)
content_copyCOPY

https://app.dataquest.io/c/56/m/307/the-mode/5/special-cases?path