in meinem code
Code: Alles auswählen
def undate(x):
if isinstance(x, (int, float)):
if not pd.notna(x):
x = u''
return x.strftime('%d.%m.%Y') if hasattr(x, 'strftime') else x
xlsx = pd.ExcelFile(input_file)
for sheet_name in xlsx.book.sheets():
sheet = xlsx.parse(sheet_name.name, header=None)
if not sheet.empty:
update_sheet = sheet.applymap(undate)
Alles läuft zwar wie es soll, aber in Pycharm läuchtet "x.strftime('%d.%m.%Y')" mit dem Hinweis: 'str' object is not callable
heller auf. Irgendwie stört mich das. Kann man das irgendwie beheben?