I have a program with a nested structure that is currently written using the obvious approach for appending a list-of-lists to the top-level DataFrame (by creating a DataFrame from that list-of-lists and then appending that to the target DataFrame): 
import pandas as pd
columns=["inner", "outer", "col1", "col2", "col3", "col4"]
def create_children(inner, outer):
    results = []
    for i in range(inner):
        results.append([f'{i}', f'{outer}', 'a', 'b', 'c', 'd'])
    return results
def test(outer, inner):
    df = pd.DataFrame(columns=columns)
    for i in range(outer):
        children = create_children(inner, i)
        child_df = pd.DataFrame(children, columns=columns)
        df = pd.concat([df, child_df]) # Faster than append
    return df
The problem is that when I profile this, the creation of the child DataFrame is taking a serious amount of time:
Timer unit: 1e-06 s
Total time: 0.012352 s
File: <ipython-input-43-d816d566eb1b>
Function: test at line 1
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
     1                                           def test(outer, inner):
     2         1       5542.0   5542.0     44.9      df = pd.DataFrame(columns=columns)
     3         3          5.0      1.7      0.0      for i in range(outer):
     4         2         10.0      5.0      0.1          children = create_children(inner, i)
     5         2       4341.0   2170.5     35.1          child_df = pd.DataFrame(children, columns=columns)
     6         2       2454.0   1227.0     19.9          df = pd.concat([df, child_df])
     7                                           # Works in this case but problems with an index and slightly slower
     8                                           #         df = df.append(child_df)
     9                                           
    10         1          0.0      0.0      0.0      return df
If I rewrite this simple example to only create the DataFrame at the end, then it is significantly faster:
def test2(outer, inner):
    all_children = []
    for i in range(outer):
        children = create_children(inner, i)
        all_children.extend(children)
    df = pd.DataFrame(all_children, columns=columns)
    return df
Giving:
Timer unit: 1e-06 s
Total time: 0.002104 s
File: <ipython-input-44-05d8d95dfe60>
Function: test2 at line 1
Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
     1                                           def test2(outer, inner):
     2         1          1.0      1.0      0.0      all_children = []
     3         3          4.0      1.3      0.2      for i in range(outer):
     4         2          8.0      4.0      0.4          children = create_children(inner, i)
     5         2          2.0      1.0      0.1          all_children.extend(children)
     6                                           
     7         1       2088.0   2088.0     99.2      df = pd.DataFrame(all_children, columns=columns)
     8                                                   
     9         1          1.0      1.0      0.0      return df
Unfortunately, the program in question makes use of DataFrame features in the outer loop, so I can't simply eliminate the use of the DataFrame. (My ultimate goal is to do this, but it is a fair bit of refactoring.)
My question is: Is there a way to append a conforming list-of-lists to a DataFrame without creating the intermediate DataFrame, which seems to entail a lot of overhead?
 
    