Error when trying to sum an array by block's
In case anyone else has a similar problem but the chosen answer doesn't solve it, one possibility could be that in Python3, some index or integer quantity fed into a np function is an expression using '/' for example n/2, which ought to be '//'.
I have a large dataset stored in a numpy array (A) I am trying to sum by block's using:
B=numpy.add.reduceat(numpy.add.reduceat(A, numpy.arange(0, A.shape[0], n),axis=0), numpy.arange(0, A.shape[1], n), axis=1)
it work's fine when i try it on a test array but with my data's I get the following message:  
TypeError: Cannot cast array data from dtype('float64') to dtype('int32') according to the rule 'safe'
Does someone now how to handle this?
Thanks for the help.