Spaces:
Runtime error
Runtime error
mohamed.tsouli
commited on
Commit
·
417cac0
1
Parent(s):
55acd92
fix lwoer case
Browse files
retrieve_coefs_max_yield.py
CHANGED
@@ -43,7 +43,8 @@ def get_coefs_Kc_Ky_and_max_yield(culture: str, region: str = "Bourgogne-Franche
|
|
43 |
df_yield = df_yield[df_yield["LIB_REG2"]==region]
|
44 |
# filter the crop
|
45 |
# check if the culture name is part of the string "LIB_SAA"
|
46 |
-
|
|
|
47 |
# filter the crop
|
48 |
df_yield = df_yield[isdf_yield]
|
49 |
# calculate the max yield from columns REND_2010 to REND_2023
|
@@ -56,7 +57,7 @@ if __name__ == "__main__":
|
|
56 |
|
57 |
# Exemple d'utilisation
|
58 |
region = "Bourgogne-Franche-Comté"
|
59 |
-
culture = "
|
60 |
df_coef, yield_max = get_coefs_Kc_Ky_and_max_yield(culture, region)
|
61 |
|
62 |
print(df_coef)
|
|
|
43 |
df_yield = df_yield[df_yield["LIB_REG2"]==region]
|
44 |
# filter the crop
|
45 |
# check if the culture name is part of the string "LIB_SAA"
|
46 |
+
df_yield["LIB_SAA"] = df_yield["LIB_SAA"].str.lower()
|
47 |
+
isdf_yield = df_yield["LIB_SAA"].str.contains(culture_yield.lower())
|
48 |
# filter the crop
|
49 |
df_yield = df_yield[isdf_yield]
|
50 |
# calculate the max yield from columns REND_2010 to REND_2023
|
|
|
57 |
|
58 |
# Exemple d'utilisation
|
59 |
region = "Bourgogne-Franche-Comté"
|
60 |
+
culture = "Blé tendre d'hiver"
|
61 |
df_coef, yield_max = get_coefs_Kc_Ky_and_max_yield(culture, region)
|
62 |
|
63 |
print(df_coef)
|