performance – Removes nested python loops

I have the following work code, but it is too slow because I have to run the same code for multiple files in one folder. Help me avoid the nested loop or make it more efficient.

def create_nodes (self):
for the child in self.tree.getroot ():
columnNames = child.attrib
events = [grandchild.attrib for grandchild in child]
    return (columnNames, events)

def create_game_data (auto):
columns = {}
for the column in self.create_nodes ()[0].clés ():
columns[column] = []
        columnValues ​​= []
        for event in self.create_nodes ()[1]:
columnValues.append (self.create_nodes ()[0][column]) if the column is in self.create_nodes ()[0].keys () else columnValues.append ("NA")
columns[column] = column value
return columns