Skip to content

Commit be89028

Browse files
Address comment
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
1 parent 1f0f4dd commit be89028

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/pyspark/pandas/frame.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9878,9 +9878,8 @@ def describe(self, percentiles: Optional[List[float]] = None) -> "DataFrame":
98789878
.select("column_name", "value", F.col("count").alias("freq"))
98799879
.collect()
98809880
)
9881-
top_freq_dict = {row.column_name: (row.value, row.freq) for row in top_values}
9882-
tops = [str(top_freq_dict[col_name][0]) for col_name in column_names]
9883-
freqs = [str(top_freq_dict[col_name][1]) for col_name in column_names]
9881+
top_freq_dict = {row.column_name: (str(row.value), str(row.freq)) for row in top_values}
9882+
tops, freqs = map(list, zip(*(top_freq_dict[col_name] for col_name in column_names)))
98849883
stats = [counts, uniques, tops, freqs]
98859884
stats_names = ["count", "unique", "top", "freq"]
98869885

0 commit comments

Comments
 (0)