Plots boxplots for specified columns of a DataFrame using PySpark.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
Examples:
>>> from pyspark.sql import SparkSession
>>> from pyspark.sql.types import StructType, StructField, IntegerType
>>> spark = SparkSession.builder.getOrCreate()
>>> schema = StructType([
... StructField("id", IntegerType(), True),
... StructField("score1", IntegerType(), True),
... StructField("score2", IntegerType(), True)
... ])
>>> data = [(1, 10, 15), (2, 15, 20), (3, 25, 30), (4, 5, 12)]
>>> df = spark.createDataFrame(data, schema)
>>> plot_boxplots(df, ["score1", "score2"])
Logs:
- INFO: Plotting boxplot for column:
score1 - INFO: Plotting boxplot for column:
score2