diff --git a/solution/1700-1799/1757.Recyclable and Low Fat Products/README.md b/solution/1700-1799/1757.Recyclable and Low Fat Products/README.md index f26afaa90adca..57ebdfc5ff059 100644 --- a/solution/1700-1799/1757.Recyclable and Low Fat Products/README.md +++ b/solution/1700-1799/1757.Recyclable and Low Fat Products/README.md @@ -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 +``` + diff --git a/solution/1700-1799/1757.Recyclable and Low Fat Products/README_EN.md b/solution/1700-1799/1757.Recyclable and Low Fat Products/README_EN.md index 4b078e3fa825c..904cb8c31bede 100644 --- a/solution/1700-1799/1757.Recyclable and Low Fat Products/README_EN.md +++ b/solution/1700-1799/1757.Recyclable and Low Fat Products/README_EN.md @@ -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 +``` + diff --git a/solution/1700-1799/1757.Recyclable and Low Fat Products/Solution.py b/solution/1700-1799/1757.Recyclable and Low Fat Products/Solution.py new file mode 100644 index 0000000000000..01b0f3850eaeb --- /dev/null +++ b/solution/1700-1799/1757.Recyclable and Low Fat Products/Solution.py @@ -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