Intrigue

Retourne une PySparkPlotAccessor valeur pour les fonctions de traçage.

Vous pouvez créer des tracés de deux façons :

  • Style chaînage : df.plot.line(...)
  • Style explicite : df.plot(kind="line", ...)

Retours

plot.core.PySparkPlotAccessor

Exemples

data = [("A", 10, 1.5), ("B", 30, 2.5), ("C", 20, 3.5)]
columns = ["category", "int_val", "float_val"]
df = spark.createDataFrame(data, columns)
type(df.plot)
# <class 'pyspark.sql.plot.core.PySparkPlotAccessor'>
df.plot.line(x="category", y=["int_val", "float_val"])
df.plot(kind="line", x="category", y=["int_val", "float_val"])