title: Python dictionary set all values to class object
body: <p>After having created a dictionary from one dataframe column as keys, I want to set all values to an instance of an object (the class serves as container for storing key statistics for each row of the original pandas dataframe).</p>
  
  <p>Hence, I tried this:</p>
  
  <pre><code>class Bond:
      def __init__(self):
          self.totalsize = 0
          self.count = 0
  
  if __name__ == '__main__':
  
      isin_dict = list_of_isins.set_index('isin').T.to_dict()
      isin_dict = dict.fromkeys(isin_dict, Bond())
  </code></pre>
  
  <p>The problem is that all values in <code>isin_dict</code> point to the same address, ie all rows share the same <code>Bond</code> class object.
  How could I create a dictionary with each key holding a separate class instance as value?</p>