Skip to content

Commit

Permalink
Merge pull request #13633 from tupui/maint_binned_stats_func
Browse files Browse the repository at this point in the history
MAINT: stats.binned_statistic_2d user function expecting arrays
  • Loading branch information
rgommers committed Mar 13, 2021
2 parents 38afa7c + 869c869 commit b0936fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scipy/stats/_binned_statistic.py
Expand Up @@ -645,7 +645,7 @@ def _calc_binned_statistic(Vdim, bin_numbers, result, values, stat_func,
# if the stat_func is np.std, calc std only when binned data is 2
# or more for speed up.
if is_callable or not (stat_func is np.std and len(bin_map[i]) < 2):
result[vv, i] = stat_func(bin_map[i])
result[vv, i] = stat_func(np.array(bin_map[i]))


def _create_binned_data(bin_numbers, unique_bin_numbers, values, vv):
Expand Down

0 comments on commit b0936fe

Please sign in to comment.