(obj)
Convert a numpy data type to a standard python scalar.
Convert a numpy data type to a standard python scalar.
Convert a numpy data type to a standard python scalar .
def to_scalar_safe(obj):
    """
    Convert a numpy data type to a standard python scalar.
    """
    try:
        return obj.item()
    except Exception:
        return obj
def to_scalar_safe ( obj ) : try : return obj . item ( ) except Exception : return obj