diff --git a/Big Countries b/Big Countries new file mode 100644 index 0000000..af3aef6 --- /dev/null +++ b/Big Countries @@ -0,0 +1,6 @@ +import pandas as pd + +def big_countries(world: pd.DataFrame) -> pd.DataFrame: + df = world[(world['area'] >= 3000000) | (world['population'] >= 25000000)] + return df[['name', 'population', 'area']] + \ No newline at end of file diff --git a/Customer Who Never Order b/Customer Who Never Order new file mode 100644 index 0000000..d0ec5b1 --- /dev/null +++ b/Customer Who Never Order @@ -0,0 +1,7 @@ +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'].isna()] + return df[['name']].rename(columns={'name': 'Customers'}) + \ No newline at end of file diff --git a/Recyclable and Low Fat Products b/Recyclable and Low Fat Products new file mode 100644 index 0000000..4e658fc --- /dev/null +++ b/Recyclable and Low Fat Products @@ -0,0 +1,5 @@ +import pandas as pd + +def find_products(products: pd.DataFrame) -> pd.DataFrame: + df = products[(products['low_fats'] == 'Y') & (products['recyclable'] == 'Y')] + return df[['product_id']] \ No newline at end of file