我有这个函数可以将英语月份转换为法语月份:
def changeMonth(month):
global CurrentMonth
match month:
case "Jan":
return "Janvier"
case "Feb":
return "Février"
case "Mar":
return "Mars"
case "Apr":
return "Avril"
case "May":
return "Mai"
case "Jun":
return "Juin"
case "Jul":
return "Juillet"
case "Aug":
return "Août"
case "Sep":
return "Septembre"
case "Oct":
return "Octobre"
case "Nov":
return "Novembre"
case "Dec":
return "Décembre"
# If an exact match is not confirmed, this last case will be used if provided
case _:
return ""
我有一只熊猫df["month"]= df['ic_graph']['month'].tolist()
:
现在我要找的是通过 changeMonth 函数传递 df["month"] col 来显示法国月份的 df["month"]
顺便说一句,我不想使用
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'fr_FR')