[go: up one dir, main page]

Return 0 when pysal returns NaN for a calculation

Especially regarding JSON NaN is an invalid token.

Research about the specific error case which happens during the calculation G_Local and Moran (is it an error in the neighborhood conception in general? Or a bug in pysal?)

A quick fix (without being sure if this is totally correct) just check if the calculated value from pysal is NaN (np.isnan(value)) and if true simply return 0.

The code for this has to be placed in the Result object in the _new_props_to_rows method

Edited by Philipp Loose