title: Converting a list of objects to a pandas dataframe
body: <p>How do I convert a list of objects to a pandas dataframe?</p>
  
  <pre><code>class Person(object):
      def __init__(self):
          self.name = ""
          self.year = 0
          self.salary = 0
  </code></pre>
  
  <p>For example below works but I want to have a list of person classes instead</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  data = {'name': ['Alice', 'Bob', 'Charles', 'David', 'Eric'],
      'year': [2017, 2017, 2017, 2017, 2017],
      'salary': [40000, 24000, 31000, 20000, 30000]}
  
  df = pd.DataFrame(data, index = ['Acme', 'Acme', 'Bilbao', 'Bilbao', 'Bilbao'])
  
  print(df)
  </code></pre>