SQL for Pandas, Spark, and Dask DataFrames with Fugue

GeoSense ✅
2 min readApr 8, 2023

Fugue is a framework that simplifies distributed computing by abstracting away the complexities of distributed systems, allowing users to write high-level code in familiar languages like Python, Pandas, and SQL, and then automatically optimizes and executes that code on distributed computing frameworks like Spark, Dask, and Ray.

This approach not only reduces the amount of code required but also ensures that the code is optimized for the specific distributed computing framework being used, leading to more efficient execution and faster completion times for big data projects. Additionally, Fugue provides a range of tools and features for monitoring and debugging distributed applications, making it easier for developers to build, test, and maintain their code.

from fugue-tutorials website

Installation

pip install fugue

Backend engines are installed separately through pip extras. For example, to install Spark:

pip install fugue[spark]

If Spark, Dask, or Ray are already installed on your machine, Fugue will be able to detect it. Spark requires Java to be installed separately.

Examples

from fugue_notebook import setup
setup()
import pandas as pd
df = pd.DataFrame({"col1"…

--

--

GeoSense ✅

🌏 Remote sensing | 🛰️ Geographic Information Systems (GIS) | ℹ️ https://www.tnmthai.com/medium