Perform statistical analysis on columns of the DataFrame.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
Examples:
>>> from pyspark.sql import SparkSession
>>> from pyspark.sql.types import StructType, StructField, IntegerType, StringType # noqa : E501
>>> spark = SparkSession.builder.getOrCreate()
>>> schema = StructType([
... StructField("id", IntegerType(), True),
... StructField("score", IntegerType(), True),
... StructField("category", StringType(), True)
... ])
>>> data = [(1, 10, "A"), (2, 15, "B"), (3, 25, "A"), (4, 5, "C")]
>>> df = spark.createDataFrame(data, schema)
>>> try:
... analysis_df = standard_analyses(df, numeric_columns=["score"])
... except ValueError as e:
... print(e)
Logs:
- INFO: Total rows in the DataFrame:
rows_number - INFO: Processing column
id - INFO: Processing column
score - INFO: Processing column
category - INFO: Data Quality Check: Successfully processed standard analysis.