title: Convert a data frame to a dictionary with a few keys (member_IDs) and additive values (account balances)
body: <p>I have following problem:
  My goal is to extract the unique member IDs of a data frame and have the as keys and also extract and sum up the transactions they have and have them as values.</p>
  
  <p><em>unique mem_id = e.g. 70850441974905670928446</em></p>
  
  <p><em>amount = 150.78</em></p>
  
  <p><em>card_members = df['unique_mem_id'].unique()</em></p>
  
  <p>EDIT:
  Here an excerpt from the dataframe:</p>
  
  <pre><code>transaction_date    unique_mem_id   description amount
  6/21/2014   7.08504E+22 HILLERS MARKET         NORTHVILLE   MI  61.72
  6/22/2014   7.08504E+22 BUSCH'S #1032          PLYMOUTH     MI  25.48
  6/23/2014   7.08504E+22 SPEEDWAY XXXXX 5 M     PLYMOUTH     MI  30.73
  6/23/2014   7.08504E+22 HENDERSON GLASS INC    NOVI         MI  29.95
  6/23/2014   7.08504E+22 HILLERS MARKET         NORTHVILLE   MI  59.6
  6/23/2014   7.08504E+22 SPEEDWAY XXXXX 5 M     PLYMOUTH     MI  60.59
  6/24/2014   7.08504E+22 BEACHWAY RESORT        SAUGATUCK    MI  1142.4
  6/24/2014   7.08504E+22 PUMPERNICKELS EATERY   SAUGATUCK    MI  88.52
  6/24/2014   7.08504E+22 DEMOND'S SUPER         DOUGLAS      MI  79.75
  6/25/2014   7.08504E+22 DEMOND'S SUPER         DOUGLAS      MI  128.21
  </code></pre>
  
  <p>EDIT END</p>
  
  <blockquote>
    <p>DatetimeIndex: 852 entries, 2014-06-21 to 2020-01-23 Data columns
    (total 4 columns):  #   Column            Non-Null Count  Dtype       </p>
    
    <p>---  ------            --------------  -----<br>
    0   transaction_date  852 non-null    datetime64[ns]<br>
    1   unique_mem_id   852 non-null    object<br>
    2   description       852 non-null   object<br>
    3   amount            852 non-null    float64<br>
    dtypes: datetime64ns, float64(1), object(2) memory usage: 53.3+ KB</p>
  </blockquote>
  
  <p>This is the dictionary I tried to code:</p>
  
  <pre><code>#test for transactions
  from collections import defaultdict
  transaction_dict = defaultdict(list)
  
  for row in df_card.items():
      try:
          key = card_members
          value = df_card.amount
      except ValueError:
          continue
  
      transaction_dict[key] += value
  
  print(transaction_dict)
  </code></pre>
  
  <p>THe error that comes up is: unhashable type: 'numpy.ndarray'</p>
  
  <p>I have also tried df_card.iterrows() but that also fails :(</p>