Skip to main content
  • Agentic AI
  • AI Governance
  • Airflow
  • Anaconda
  • Apache Spark
  • Artificial Intelligence
  • Clustering
  • Dask
  • Data Science
  • Density-based clustering
  • dplyr
  • Factor analysis
  • Feature
  • Feature Engineering
  • Feature Extraction
  • Feature selection
  • Folium
  • GenomicRanges
  • ggmap
  • ggplot
  • GPU
  • Ground Truth
  • Hash table
  • Hyperparameter Tuning
  • Interpretability
  • Jupyter Notebook
  • Kubernetes
  • LLMOps
  • Machine Learning
  • Machine Learning Algorithms
  • MLOps
  • Model Drift
  • Model Evaluation
  • Model monitoring
  • Model Selection
  • Model Tuning
  • Overfitting
  • Plotly
  • PySpark
  • PyTorch
  • Responsible AI
  • Shiny (in R)
  • sklearn
  • spaCy
  • SR 26-2
  • Statistical Computing Environment (SCE)
  • TensorFlow
  • Underfitting
  • XGBoost
  • PySpark

    What is PySpark?

    PySpark is the Python API for Apache Spark, an open source, distributed computing framework and set of libraries for real-time, large-scale data processing. If you’re already familiar with Python and libraries such as Pandas, then PySpark is a good language to learn to create more scalable analyses and pipelines.

    Apache Spark is basically a computational engine that works with huge sets of data by processing them in parallel and batch systems. Spark is written in Scala, and PySpark was released to support the collaboration of Spark and Python. In addition to providing an API for Spark, PySpark helps you interface with Resilient Distributed Datasets (RDDs) by leveraging the Py4j library.

    Apache Spark and Python logo

    The key data type used in PySpark is the Spark dataframe. This object can be thought of as a table distributed across a cluster, and has functionality that is similar to dataframes in R and Pandas. If you want to do distributed computation using PySpark, then you’ll need to perform operations on Spark dataframes and not other Python data types.

    One of the key differences between Pandas and Spark dataframes is eager versus lazy execution. In PySpark, operations are delayed until a result is actually requested in the pipeline. For example, you can specify operations for loading a data set from Amazon S3 and applying a number of transformations to the dataframe, but these operations won’t be applied immediately. Instead, a graph of transformations is recorded, and once the data are actually needed, for example when writing the results back to S3, then the transformations are applied as a single pipeline operation. This approach is used to avoid pulling the full dataframe into memory, and enables more effective processing across a cluster of machines. With Pandas dataframes, everything is pulled into memory, and every Pandas operation is applied immediately.

    Py4J is a popular library which is integrated within PySpark and allows Python to dynamically interface with JVM (Java Virtual Machine) objects. PySpark features quite a few libraries for writing efficient programs. Furthermore, there are various external libraries that are also compatible, including:

    • PySparkSQL: A PySpark library to apply SQL-like analysis on a huge amount of structured or semi-structured data. You can also use SQL queries with PySparkSQL.
    • MLlib: A wrapper over PySpark and Spark’s machine learning (ML) library. MLlib supports many machine learning algorithms for classification, regression, clustering, collaborative filtering, dimensionality reduction, and underlying optimization primitives.
    • GraphFrames: A graph processing library that provides a set of APIs for performing graph analysis efficiently, using the PySpark core and PySparkSQL. It is optimized for fast distributed computing.

    While PySpark is far easier to use than pure Spark for data scientists who know Python but not Scala, there are disadvantages too. PySpark errors will show both Java stack trace errors as well as references to the Python code, so debugging PySpark applications can be quite difficult.

    Spark involves more processing overhead and a more complicated set-up than other data processing options. Alternatives to Spark, such as Ray and Dask, have recently emerged. Dask is a pure Python framework, so most data scientists can start using Dask almost immediately.

    [@portabletext/react] Unknown block type "block.html", specify a component for it in the `components.types` prop
    Domino's logo

    Who is Domino?

    Domino Data Lab empowers the largest AI-driven enterprises to build and operate AI at scale. Domino’s Enterprise AI Platform provides an integrated experience encompassing model development, MLOps, collaboration, and governance. With Domino, global enterprises can develop better medicines, grow more productive crops, develop more competitive products, and more. Founded in 2013, Domino is backed by Sequoia Capital, Coatue Management, NVIDIA, Snowflake, and other leading investors.

    Watch Demo
    • Platform

        • AI infrastructure
        • Data management
        • AI workbench
        • MLOps
        • AI governance
        • FinOps
        • Pricing
        • Security & compliance
        • What's new
    • Solutions

      • Industries

        • Life sciences
        • Finance
        • Public sector
        • Retail
        • Manufacturing
      • Use Cases

        • Generative AI
        • Cost-effective data science
        • Self-service data science
        • Model risk management
        • Cloud data science
    • Learn

        • Events
        • Blog
        • Podcast
        • Courses and certifications
        • Data Science Dictionary
        • Documentation
        • Support
        • Demo hub
    • Company

        • About
        • Why Domino
        • Careers
        • News and press
        • Partners
        • Customers
        • Contact us

    © 2026 Domino Data Lab, Inc. Made in San Francisco.

    • Do not sell my personal information
    • Privacy policy
    • Terms and conditions
    • Security
    • Legal
    Home
    Contact us
    Watch Demo
    Contact us
    Watch Demo