python模块中读取了一个excel,其中有一列是时间,但是格式是XXXX-XX-XX,需要将此列最大日期和最小日子找到。
原来的代码在两台电脑上可以跑,但是有一台电脑会出错unsupported locale setting,不知道要怎么解决
submit_time_series = df.loc[:, '提交时间'].dropna()
locale.setlocale(locale.LC_TIME, 'zh_CN.UTF-8')
min_date = submit_time_series.min().strftime('%m{m}%d{m}').format(m='月', d='日')
max_date = submit_time_series.max().strftime('%m{m}%d{m}').format(m='月', d='日')
locale.setlocale(locale.LC_TIME, '')
尝试import locale,出错'locale' codec can't encode character '\u6708' in position 2: encoding error
import locale
locale.setlocale(locale.LC_ALL, 'chinese_simplified')