zhengruifeng opened a new pull request, #47685:
URL: https://github.com/apache/spark/pull/47685

   ### What changes were proposed in this pull request?
   Reimplement kde plot with Spark SQL
   
   
   ### Why are the changes needed?
   Existing `kde` plot is not supported with Spark Connect, due to it's based 
on mllib which is not compatible with spark connect.
   
   
   ### Does this PR introduce _any_ user-facing change?
   yes, following APIs are enabled:
   
   - `{Frame, Series}.plot.kde`
   - `{Frame, Series}.plot.density`
   - `{Frame, Series}.plot(kind="kde", ...)`
   - `{Frame, Series}.plot(kind="density", ...)`
   
   ### How was this patch tested?
   1, enabled tests
   2, manually check
   ```
   import pyspark.pandas as ps
   df = ps.DataFrame({'x': [1, 2, 2.5, 3, 3.5, 4, 5], 'y': [4, 4, 4.5, 5, 5.5, 
6, 6],})
   df.plot.kde(bw_method=0.3)
   ```
   
   before (Spark Classic):
   
![image](https://github.com/user-attachments/assets/01d5c180-e84c-4e31-b5ed-071a8b4d1227)
   
   after (Spark Connect):
   
![image](https://github.com/user-attachments/assets/472b0fec-2029-4250-a623-1fe345e4bde8)
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


-- 
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: [email protected]

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