Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

drop columns pyspark


df.drop("firstname") 
  .printSchema()
""" import col is required """  
df.drop(col("firstname")) 
  .printSchema()  
  
df.drop(df.firstname) 
  .printSchema()   
Comment

Pyspark Drop columns

list = ['Employee ID','Employee NAME','Company Name']
  
# delete two columns
dataframe = dataframe.drop(*list)
dataframe.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python pandas cumulative return 
Python :: django get user model funciton 
Python :: show aruco marker axis opencv python 
Python :: python find closest value in list to zero 
Python :: how to insert sound in python 
Python :: exoort csv google colab 
Python :: Qslider pyqt 
Python :: np replace nan 
Python :: python if else variable assignment 
Python :: python subtract one list from another 
Python :: how to check if two columns match in pandas 
Python :: take first n row of dictionary python 
Python :: window in python 
Python :: kill turtle 
Python :: dire Bonjour en python 
Python :: Make A Snake Game Using Python and Pygame 
Python :: python binary to string 
Python :: getting image from path python 
Python :: Consider using python 3 style super without arguments 
Python :: knn classifier python example 
Python :: get n items from dictionary python 
Python :: python list distinct 
Python :: python list comprehension double for 
Python :: dataframe split column 
Python :: -bash: /usr/local/bin/python3: no such file or directory 
Python :: how to create data dictionary in python using keys and values 
Python :: save pythonpath 
Python :: how to log ip addresses in python 
Python :: python set symmetric difference 
Python :: how to pick a random english word from a list 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =