Answers for "spark dataframe without column"

0

spark dataframe without column

Since Spark 1.4 you can use drop method:

#Scala
case class Point(x: Int, y: Int)
val df = sqlContext.createDataFrame(Point(0, 0) :: Point(1, 2) :: Nil)
df.drop("y")

#Python
df = sc.parallelize([(0, 0), (1, 2)]).toDF(["x", "y"])
df.drop("y")
## DataFrame[x: bigint]
Posted by: Guest on August-25-2020

Code answers related to "spark dataframe without column"

Python Answers by Framework

Browse Popular Code Answers by Language