CheatSnip

Related

Create DataFrame

pyspark

Create DataFrame from list or RDD

Show DataFrame

pyspark

Display rows of DataFrame

Print Schema

pyspark

Print schema of DataFrame

pyspark/where

Where

Alternative to filter()

pyspark
dataframe
where

Command

df.where()

Explanation

Works the same as filter() for conditions.

Examples

Filter rows with age = 30

df.where(df.age == 30).show()

More

Select Columns

pyspark

Select specific columns from DataFrame

Filter Rows

pyspark

Filter DataFrame based on condition

Group By

pyspark

Group DataFrame by column(s)

CheatSnip

Lightning-fast access to essential developer commands and code snippets. Search, copy, and master your favorite tools with our comprehensive cheat sheets.

Poorna Prakash

Quick Links

Git CommandsDockerNPMKubernetesYour Favorites

Legal

Terms & ConditionsPrivacy PolicyCookie Preferences

Company

About UsContact

© 2025 CheatSnip. All rights reserved.

Made with ❤️ for developers