简体   繁体   中英

Pandas dataframe can't export more than 200 rows to CSV file

I am trying to export the data from salesforce using python and simple salesforce, but when I try to export the data into the CSV File I get only 200 records. Here is my code:

import pandas as pd
from simple_salesforce import Salesforce
import csv
data=Salesforce(password='*********',username='***********',organizationId='***')
results=pd.DataFrame(data.query("SELECT AccountId,
Email_To__c,EM_Escalation_Comment__c,EM_Escalation_status__c,End_Customer__c,Engineering_Action_Required__c,Engineering_Action__c,Engineering_Status__c,EntitlementId,Entitlement_check__c,EPS_Case_Tracking_ID__c,EPS_Reference__c,Error_Code__c,Escalation_Notes__c,Escalation_Status__c,Escalation_Validation__c,Event_ID__c,External_Ticket_Number__c,Handle_Time_Hours__c,Has_Article__c,Has_this_case_reopened__c,Id,Internal_Status__c,In_DBA_H FROM Case")['records'])
df=pd.DataFrame(results) 
df.to_csv('/Users/apple/Desktop/CSV-Py/Case.csv')

If the result is extremely large then query will not retrieve all the results. Use query_all instead.

https://pypi.org/project/simple-salesforce/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM