liveBook · Manning

Distributed programming

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

Distributed computing divides computation across multiple networked machines or processors.

Distributed programming divides computation across networked machines or processors. A familiar path begins with pandas: its DataFrame API supports SQL-like selection, filtering, aggregation, ordering, and joins, then provides a practical bridge toward multiprocessing or distributed computing. section 2.3.1

Joining product data

Suppose three warehouse tables describe product details, descriptions, and manufacturers. Merge them by product_id in pandas, preserve intermediate transformations, and prepare the combined dataset for analysis or machine learning. The same operation can be expressed as a SQL join. section 2.3.1

Choose distributed processing when the single-machine approach becomes limiting:

  • Pandas offers control over transformation stages and preserves characteristics such as data types and ordering. section 2.3.1
  • Pandas can be slow and cannot process data larger than available computer memory, creating efficiency and scalability limits. section 2.3.1
Listing 2.4 Merging datasets in pandas
import pandas as pd
df1 = pd.DataFrame({'product_id': [1, 2, 3, 4],
                    'product_name': ['Product A', 
                                     'Product B', 
                                     'Product C', 
                                     'Product D'],
                    'price': [10.99, 20.99, 15.99, 8.99]})           #1
df2 = pd.DataFrame({'product_id': [1, 2, 3, 4],
                 'product_description': ['A great product', 
                                         'A high-quality product', 
                                         'A reliable product', 
                                         'An affordable product'],
                 'category': ['Category A', 'Category B', 
                              'Category C', 'Category D']})          #2
df3 = pd.DataFrame({'product_id': [1, 2, 3, 4],
                    'manufacturer': ['Manufacturer A', 'Manufacturer B', 
                                     'Manufacturer C', 'Manufacturer D'],
                    'weight': [1.5, 2.0, 1.8, 1.2]})                 #3
merged_df = pd.merge(df1, df2, on='product_id')                      #4
merged_df = pd.merge(merged_df, df3, on='product_id')                #5
print(merged_df)

Inspect a concrete pandas merge that models the controlled, staged workflow preceding larger-scale processing. section 2.3.1

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains the transition and scalability rationale, but stops short of distributed-system implementation details.
Examples
Demonstrates joining three product tables with SQL and pandas merge operations.
What it assumes
Assumes familiarity with tabular data and teaches through pandas operations analogous to relational-database queries.
What you can do after
Apply distributed-computing reasoning by identifying when pandas becomes inefficient or exceeds available memory.
How it connects
Connects pandas, DataFrames, SQL joins, multiprocessing, relational databases, and machine learning.

Also explained in

Compare how 3 books explain distributed programming →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.