📜  没有列的火花数据框 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:24.846000             🧑  作者: Mango

代码示例1
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]