Sunday, September 20, 2020

Pyspark drop column

We need to drop addr1 from below schema 

>>> df3.printSchema()

 |-- cat: string (nullable = true)

 |-- age: string (nullable = true)

 |-- addr: string (nullable = true)

 |-- addr1: integer (nullable = true)


df4=df3.drop('addr1')

>>> df4.printSchema()

root

 |-- cat: string (nullable = true)

 |-- age: string (nullable = true)

 |-- addr: string (nullable = true)

No comments:

Post a Comment