title: Unable to convert a list into a dataframe. Keep getting the error "ValueError: Must pass 2-d input. shape=(1, 4, 5)"
body: <p>I have to 2 dfs:</p>
  <p><strong>dfMiss:</strong></p>
  <p><a href="https://i.stack.imgur.com/Jj5V4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jj5V4.png" alt="enter image description here" /></a></p>
  <p>and</p>
  <p><strong>dfSuper:</strong></p>
  <p><a href="https://i.stack.imgur.com/vdbuH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vdbuH.png" alt="enter image description here" /></a></p>
  <p>I need to create a final output that summarises the data in the 2 tables which I am able to do shown in the code below:</p>
  <pre><code>dfCity = dfSuper \
      .groupby(by='City').count() \
      .drop(columns='Superhero ID') \
      .rename(columns={'Superhero': 'Total count'})
  
  print(&quot;This is the df city : &quot;)
  print(dfCity)
  
  
  
  ## Convert column MissionEndDate to DateTime format
  for df in dfMiss:
      # Dates are interpreted as MM/dd/yyyy by default, dayfirst=False
      df['Mission End date'] = pd.to_datetime(df['Mission End date'], dayfirst=True)
  
      # Get Year and Quarter, given Q1 2020 starts in April
      date = df['Mission End date'] - pd.DateOffset(months=3)
      df['Mission End quarter'] = date.dt.year.astype(str) + ' Q' + date.dt.quarter.astype(str)
  
  ## Get no. Superheros working per City per Quarter
  dfCount = []
  
  for dfM in dfMiss:
      # Merge DataFrames
      df = dfSuper.merge(dfM, left_on='Superhero ID', right_on='SID')
  
   
      df = df.pivot_table(index=['City', 'Superhero'], columns='Mission End quarter', aggfunc='nunique')
  
      # Get the first group (all the groups have the same values)
      df = df[df.columns[0][0]]
  
      # Group the values by City (effectively &quot;collapsing&quot; the 'Superhero' column)
      df = df.groupby(by=['City']).count()
  
      dfCount += [df]
  
  ## Get no. Superheros available per City per Quarter
  dfFree = []
  
  for dfC in dfCount:
  
      # Merge DataFrames
      df = dfCity.merge(right=dfC, on='City', how='outer').fillna(0)  # convert NaN values to 0
  
      # Subtract no. working superheros from total no. superheros per city
      for col in df.columns[1:]:
          df[col] = df['Total count'] - df[col]
      dfFree += [df.astype(int)]
  
      print(dfFree)
  dfResult = pd.DataFrame(dfFree)
  </code></pre>
  <p>The problem is when I try to convert DfFree into a dataframe I get the error:</p>
  <p><strong>&quot;ValueError: Must pass 2-d input. shape=(1, 4, 5) &quot;</strong></p>
  <p>The line that raises the error is</p>
  <pre><code>dfResult = pd.DataFrame(dfFree)
  </code></pre>
  <p>Anyone have any idea what this means and how I can convert the list into a df?</p>
  <p>Thanks :)</p>