Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Python - TypeError: Object Of Type 'Int64' Is Not JSON Serializable

Asked by Ankur Vaish Nov 16, 2022 1.8K views 1 answer
Share

About this question

 have a Dataframe that stores Store name and daily sales count. I am trying to insert this to Salesforce using the below Python script. I, however, get an error.

TypeError: Object of type 'int64' is not JSON serializable
Given below is the view of the dataframe:
Storename,Count
Store A,10
Store B, 12
Store C, 5
I use the below code to insert it to Salesforce:
update_list = []
for i in range((len(store))):
    update_data = {
               'name' :    store['entity_name'].iloc[i],
                'count__c': store['count'].iloc[i] }
    update_list.append(update_data)
sf_data_cursor = sf_datapull.salesforce_login()
sf_data_cursor.bulk.Account.update(update_list)
Get the error the last line above gets executed. Could anyone assist in fixing this.

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.