gatorsmile commented on a change in pull request #28928:
URL: https://github.com/apache/spark/pull/28928#discussion_r445976618



##########
File path: python/pyspark/sql/pandas/conversion.py
##########
@@ -413,7 +413,7 @@ def _create_from_pandas_with_arrow(self, pdf, schema, 
timezone):
 
         # Slice the DataFrame to be batched
         step = -(-len(pdf) // self.sparkContext.defaultParallelism)  # round 
int up
-        pdf_slices = (pdf[start:start + step] for start in xrange(0, len(pdf), 
step))
+        pdf_slices = (pdf.iloc[start:start + step] for start in xrange(0, 
len(pdf), step))

Review comment:
       Thank you for fixing this! 
   
   > While standard Python / Numpy expressions for selecting and setting are 
intuitive and come in handy for interactive work, for production code, we 
recommend the optimized pandas data access methods, .at, .iat, .loc and .iloc.
   
   Is it the only place? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to