if 'time_start' in df.columns.tolist(): df = df.astype(data_types_dict) elif 'time_start'.upper() in df.columns.tolist(): data_types_dict_upper = {} for i, j in data_types_dict.items(): data_types_dict_upper[i.upper()] = j # print('=====', data_types_dict_upper) df = df.astype(data_types_dict_upper)
if 'time_start' in df.columns.tolist(): df = df.rename(columns=rename_col) elif 'time_start'.upper() in df.columns.tolist(): rename_col_upper = {} for i, j in rename_col.items(): rename_col_upper[i.upper()] = j # print('=====', rename_col_upper) df = df.rename(columns=rename_col_upper)