code: def to_json(df, state_index, color_index, fills):
          
          records = {}
          for i, row in df.iterrows():
  
              records[row[state_index]] = {
                  "fillKey": row[color_index]
              }
  
          return {
              "data": records,
              "fills": fills
          }
docs: Transforms dataframe to json response