vendredi 6 décembre 2019

Not getting the result while doing if condition [closed]

I was trying to a calculate in an array with xarray, the array consists of latitudes and longitudes (501x572) and the temperature data. I want to do calculation throughout the array when the condition satisfies temp < 230 on each data points.

temp = imr['irwin_cdr']
a = 6.96
if (temp < 230).all():
    pi = a*(230-temp)
print(pi)

but i am getting an error,

NameError: name 'pi' is not defined

How to solve this issue? Some could suggest any solutions, I really appreciate that.

Aucun commentaire:

Enregistrer un commentaire