I got a problem with output types on the mode mission.
def mode_intervals(array): interval_left = gr_freq_table.idxmax().left interval_right = gr_freq_table.idxmax().right interval_range = interval_right-interval_left mode = interval_left + interval_range/2 return int(mode) mode = mode_intervals(gr_freq_table) mean = houses["SalePrice"].mean() median = houses["SalePrice"].median() sentence_1 = mode < median < mean sentence_2 = mean > median > mode
What I expected to happen: Both sentences should be “True”.
What actually happened: But an error occurs for sentence_1: Instead of bool_ we expected bool.
So why are there 2 outcomes of the same logic? Why it mixes numpy and python booleans?
If I do:
sentence_1 = bool(mode < median < mean) sentence_2 = mean > median > mode
the problem is solved.