Skip to content

Instantly share code, notes, and snippets.

@lalitsingh24x7
Created April 8, 2025 19:57
Show Gist options
  • Select an option

  • Save lalitsingh24x7/03971ccd9632a1194934c25b7a4925ee to your computer and use it in GitHub Desktop.

Select an option

Save lalitsingh24x7/03971ccd9632a1194934c25b7a4925ee to your computer and use it in GitHub Desktop.
sample_data
# Create the customers DataFrame
customers_data = [(101, "Lalit"), (102, "Neha")]
customers = spark.createDataFrame(customers_data, ["customer_id", "customer_name"])
# Create the orders DataFrame
orders_data = [(1, 101, 250), (2, 102, 150), (3, 0, 100), (4, None, 200)]
orders = spark.createDataFrame(orders_data, ["order_id", "customer_id", "order_amount"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment