data_cube_notebooks
data_cube_notebooks copied to clipboard
get a TypeError when plotting
code :- import utils.data_cube_utilities.plotter_utils as plotter plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr)
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
--> 657 within plotter_utils.py mask = ~np.isnan(means) & ~np.isnan(medians)
Notebook name :- NDVI_Thresholds
the error can be fixed by replacing np.isnan with pd.isnull
however, the next immediate line throws an error. This is because the method is not defined to receive two xarray datasets as arguments and is as follows :-
def plot_band(dataset, figsize=(20,15), fontsize=24, legend_fontsize=24)
however, the call made in the notebook is
plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr)
and the ndvi_data_arr is interpreted as the figsize
plotter.plot_band(cleaned_landsat_dataset, ndvi_data_arr) should be changed to plotter.plot_band(ndvi_data_arr)