diff --git a/src/cheetahpy/local_opendata.py b/src/cheetahpy/local_opendata.py index 8e56bde..f3a6381 100644 --- a/src/cheetahpy/local_opendata.py +++ b/src/cheetahpy/local_opendata.py @@ -95,7 +95,12 @@ def _safe_convert(original_series:pd.Series, type_convert:type) -> pd.Series: new_series = original_series.astype(type_convert) return new_series except Exception as err: - print(f'{err}: cannot convert {type(original_series)} to type {type_convert}') + a_value = original_series.dropna().tolist() + if len(a_value) > 0: + a_value_type = type(a_value[0]) + else: + a_value_type = "UNKNOWN" + print(f'{err}: cannot convert {original_series.name} (of type: {a_value_type}) to type {type_convert}') return original_series @staticmethod