import pandas as pd def is_number(value): try: pd.to_numeric(value) return True except (ValueError, TypeError): return False