Tomt

Returnerar en PySparkPlotAccessor för plottningsfunktioner.

Du kan skapa diagram på två sätt:

  • Länkningsformat: df.plot.line(...)
  • Explicit formatmall: df.plot(kind="line", ...)

Retur

plot.core.PySparkPlotAccessor

Exempel

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"])