Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions problem2-595-big-countries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pandas as pd


def big_countries(world: pd.DataFrame) -> pd.DataFrame:
return world[(world['area'] >= 3000000) | (world['population'] >= 25000000)][['name', 'population', 'area']]
5 changes: 5 additions & 0 deletions problem3-1757-recycle-and-low-fat-products.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pandas as pd


def find_products(products: pd.DataFrame) -> pd.DataFrame:
return products[(products['low_fats'] == 'Y') & (products['recyclable'] == 'Y')][['product_id']]
8 changes: 8 additions & 0 deletions problem4-183-customer-who-never.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pandas as pd


def find_customers(customers: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:
df = customers.merge(orders, left_on='id', right_on='customerId', how='left')

df = df[df['customerId'].isnull()][['name']].rename(columns={'name': 'Customers'})
return df