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
7 changes: 7 additions & 0 deletions BigCountries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pandas as pd

def big_countries(world: pd.DataFrame) -> pd.DataFrame:
return world.loc[
(world['area'] >= 3000000) | (world['population'] >= 25000000),
['name', 'population','area']]

4 changes: 4 additions & 0 deletions LowFatProduct.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.loc[(products['low_fats'] == 'Y') & (products['recyclable'] == 'Y'), ['product_id']]
6 changes: 6 additions & 0 deletions PandasDataFrameFromList.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pandas as pd
lst = [['Geek', 25], ['is', 30],
['for', 26], ['GeeksforGeeks', 22]]
df = pd.DataFrame(lst, columns=['Tag', 'number'])
print(df)