Skip to content
Open

Done #49

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 Problem 2 BigCountries.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:
df = world[(world['area']>=3000000) | (world['population']>=25000000)]
return df[['name','population','area']]
4 changes: 4 additions & 0 deletions Problem 3 Recyclable and Low Fat Products.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pandas as pd

def find_products(products: pd.DataFrame) -> pd.DataFrame:
return products[(products['low_fats']=='Y') & (products['recyclable']=='Y')][['product_id']]
5 changes: 5 additions & 0 deletions Problem 4 Customer Who Never Order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pandas as pd

def find_customers(customers: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:
return customers[~customers['id'].isin(orders['customerId'])][['name']].rename(columns ={'name':'Customers'})

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pandas1

1 Problem 1 : Make a Pandas DataFrame with two-dimensional list ( https://www.geeksforgeeks.org/make-a-pandas-dataframe-with-two-dimensional-list-python/)
1 Problem 1 : Make a Pandas DataFrame with two-dimensional list ( https://www.geeksfor geeks.org/make-a-pandas-dataframe-with-two-dimensional-list-python/)

2 Problem 2 :Big Countries ( https://leetcode.com/problems/big-countries/ )

Expand Down