Data Science, Pyspark, Data Analytics, Machine Learning, Artificial Intelligence.
Calculate percentiles top_percentile = closing_prices_df.approxQuantile("closing_price", [0.8], 0.01)[0] bottom_percentile = closing_prices_df.approxQuantile("closing_price", [0.2], 0.01)[0] values = closing_prices_df.select("closing_price").rdd.flatMap(lambda x: x) # Plot histogram using