def one_dict(list_dict):
    """
    converts a list of dictionaries on a dictionary of lists.
    Example:
       [
         {'a_key': 'a_value_1', 'b_key': 'b_value_1'},
         {'a_key': 'a_value_2', 'b_key': 'b_value_2'}
       ]
    becomes:
       {
         'a_key': ['a_value_1', 'a_value_2'],
         'b_key': ['b_value_1', 'b_value_2'],
       }
    This is useful to process data with Pandas. The output of this
    function ca be used to build a Panda DataSet using the DataFrame
    constructor
    """

    # This extract the keys
    keys = list_dict[0].keys()
    # keys = ['a_key', 'b_key']

    # initialize dictionary
    out_dict = {key: [] for key in keys}
    # out_dict = {'a_key': [], 'b_key': []}

    for dict_ in list_dict:
        # for every element (dictionary) in input list, e.g.:
        #   {'a_key': 'a_value_1', 'b_key': 'b_value_1'}
        for key, value in dict_.items():
            # extract the key,value pairs, e.g.:
            #   'a_key', 'a_value_1'
            # and insert the value in the correct list of the
            # output dictionary, e.g.:
            #   out_dict['a_key'].append('a_value_1')
            out_dict[key].append(value)
            # after first iteration, for example out_dict will be:
            #   out_dict = {'a_key': ['a_value_1'], 'b_key': []}
        # after first complete execution of the internal loop:
        #   out_dict = {'a_key': ['a_value_1'], 'b_key': ['b_value_1']}

    # after completation of all iterations:
    #   out_dict = {
    #     'a_key': ['a_value_1', 'a_value_2'],
    #     'b_key': ['b_value_1', 'b_value_2'],
    #   }
    return out_dict