Skip to content
Merged
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
12 changes: 12 additions & 0 deletions solution/1700-1799/1757.Recyclable and Low Fat Products/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@ FROM Products
WHERE low_fats = 'Y' AND recyclable = 'Y';
```

### **PANDAS**

```python
import pandas as pd


def find_products(products: pd.DataFrame) -> pd.DataFrame:
rs = products[(products["low_fats"] == "Y") & (products["recyclable"] == "Y")]
rs = rs[["product_id"]]
return rs
```

<!-- tabs:end -->
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@ FROM Products
WHERE low_fats = 'Y' AND recyclable = 'Y';
```

### **PANDAS**

```python
import pandas as pd


def find_products(products: pd.DataFrame) -> pd.DataFrame:
rs = products[(products["low_fats"] == "Y") & (products["recyclable"] == "Y")]
rs = rs[["product_id"]]
return rs
```

<!-- tabs:end -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pandas as pd


def find_products(products: pd.DataFrame) -> pd.DataFrame:
rs = products[(products["low_fats"] == "Y") & (products["recyclable"] == "Y")]
rs = rs[["product_id"]]
return rs