Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

iterate over pyspark dataframe columns

Have you tried something like this:

names = df.schema.names
for name in names:
    print(name + ': ' + df.where(df[name].isNull()).count())

You can see how this could be modified to put the information into a dictionary or some other more useful format.

Tags:

Python

Iterator

Pyspark

Pyspark Sql

Related

Decode JSON into Elm Maybe Color theme for VS Code integrated terminal What is a keyword in Robot Framework? Promises in redux-saga How to convert a non-core csproj to VS2017 format Digital Ocean - Cloning a Production Droplet to a Staging Server How to remove illegal characters so a dataframe can write to Excel Iterate over array of objects and change one property in each object .gitignore syntax - how to exclude virtualenv sub-directories? NSManagedObject subclass mocking Bitbucket Pipelines - multiple branches with same steps Why does JavaScript's `Promise.all` not run all promises in failure conditions?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy