def _SI_prefix_to_factor(unit):
    """Convert an SI prefix to a numerical factor
    Parameters
    ----------
    unit : str
        The unit whose first character is checked against the list of
        prefactors {"M": 1e6, "k": 1e3, "m": 1e-3}
    Returns
    -------
    factor : float or `None`
        The appropriate factor or 1 if not found in the list, or `None`
        if the unit string is empty
    """
    # SI prefix to numerical value
    SI_conversion = {"M": 1e6, "k": 1e3, "m": 1e-3}
    try:  # using the unit's first character as key in the dictionary
        factor = SI_conversion[unit[0]]
    except KeyError:  # if the entry does not exist
        factor = 1
    except IndexError:  # if the unit string is empty
        factor = None
    return factor