kreślenie

Zwraca wartość PySparkPlotAccessor dla funkcji kreślenia.

Wykresy można tworzyć na dwa sposoby:

  • Styl łańcucha: df.plot.line(...)
  • Styl jawny: df.plot(kind="line", ...)

Zwroty

plot.core.PySparkPlotAccessor

Examples

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