def pandas_data_frame_to_dict(data_frame, main_key_position=0, null_value=
    'delete', header_line=0):
    """
    Converts a single file_name from xlsx to json

    Parameters
    ----------
    data_frame : pandas.core.frame.DataFrame
    main_key_position : int, optional
    null_value : any, optional
    header_line : int, optional

    Returns
    -------
    dict
        the dictionary representing the xlsx based on `main_key_position`
    """
    from pandas import notnull
    if header_line == 0:
        header = list(data_frame.keys())
    else:
        header = list(data_frame.iloc[header_line - 1])
        data_frame = data_frame[header_line:]
        data_frame.columns = header
    if null_value == 'delete':
        exchange_key = None
    else:
        exchange_key = null_value
    data_frame = data_frame.where(notnull(data_frame), exchange_key)
    data = data_frame.set_index(header[main_key_position]).T.to_dict()
    for key in data.copy():
        for key2 in data[key].copy():
            if not data[key][key2] and null_value == 'delete':
                del data[key][key2]
    data = {header[main_key_position]: data}
    return data
