xinrong-databricks commented on a change in pull request #35794:
URL: https://github.com/apache/spark/pull/35794#discussion_r823379193



##########
File path: python/pyspark/pandas/frame.py
##########
@@ -6901,6 +6904,16 @@ def sort_values(
         3     D     7     2
         2  None     8     4
 
+        Ignore index for the resulting axis
+
+        >>> df.sort_values(by=['col1'], ignore_index=True)
+           col1  col2  col3
+        0     A     2     0
+        1     B     9     9
+        2     C     4     3
+        3     D     7     2
+        4  None     8     4

Review comment:
       Thanks @itholic . The resulting index order is different considering 
different `ignore_index` input.
   ```py
           Sort by col1
   
           >>> df.sort_values(by=['col1'])
              col1  col2  col3
           0     A     2     0
           1     B     9     9
           4     C     4     3
           3     D     7     2
           2  None     8     4
   
           Ignore index for the resulting axis
   
           >>> df.sort_values(by=['col1'], ignore_index=True)
              col1  col2  col3
           0     A     2     0
           1     B     9     9
           2     C     4     3
           3     D     7     2
           4  None     8     4
   ```
   I may modify it if you still think it confusing though.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to