Closed rsaathoff closed 2 years ago
What would you like no value to be instead of null?
The value gets a 5 if we have not data. Thanks!
@rsaathoff what is the score of the null values?
Is it 0 or 1000 or somewhere in between?
texture = row[1]
if texture is None:
return ('unknown', 0)
value = texture.casefold()
if 'gravel' in value:
score = 5
elif 'cobb' in value:
score = 5
elif 'ston' in value:
score = 5
elif 'frag' in value:
score = 5
elif 'bould' in value:
score = 5
elif 'course' in value:
score = 5
elif len(value.strip()) == 0:
score = 5
elif 'sand' in value:
score = 4
elif 'flag' in value:
score = 3
elif 'channer' in value:
score = 3
elif 'varia' in value:
score = 3
elif value == 'loam':
score = 3
elif 'ashy' in value:
score = 3
elif 'shaly' in value:
score = 2
elif 'silt' in value:
score = 2
elif 'plant' in value:
score = 2
elif 'pea' in value:
score = 2
elif 'clay' in value:
score = 1
elif 'bedr' in value:
score = 1
else:
score = 1000
Did I not understand your first question when I said it gets a 5?
Let me rephrase since those are two separate questions.
The way the code is crafted, I don't see where null scores could happen.
ok, both the soilVal and soilSev are null. If the soilVal is null, you could either leave it that way or put "No data" in that field. Regardless the soilSev should get a value of 5 if their is no data. You can get rid of the else: score = 1000 and change that to 5. I don't understand how nulls can happen either with that else statement. Attached is the csv from last week TankRiskResults_20220901091604.csv
ok, let me give it a try, thanks!
Rick said it is working as expected.
The soilSev values are null in some cases which is causing errors with the import of the data. This occurs when the SoilVal is null.