HyukjinKwon commented on a change in pull request #34931:
URL: https://github.com/apache/spark/pull/34931#discussion_r773008981
##########
File path: python/pyspark/pandas/frame.py
##########
@@ -8828,22 +8846,154 @@ def describe(self, percentiles: Optional[List[float]]
= None) -> "DataFrame":
else:
percentiles = [0.25, 0.5, 0.75]
- formatted_perc = ["{:.0%}".format(p) for p in sorted(percentiles)]
- stats = ["count", "mean", "stddev", "min", *formatted_perc, "max"]
+ if len(exprs_numeric) == 0:
+ if len(exprs_non_numeric) == 0:
+ raise ValueError("Cannot describe a DataFrame without columns")
- sdf = self._internal.spark_frame.select(*exprs).summary(*stats)
- sdf = sdf.replace("stddev", "std", subset=["summary"])
+ # Handling non-numeric type columns
Review comment:
Looks like this can also be timestamp (?). `exprs_numeric` can hold
timestamps.
--
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]