File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
solution/1700-1799/1757.Recyclable and Low Fat Products Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -70,4 +70,16 @@ FROM Products
70
70
WHERE low_fats = ' Y' AND recyclable = ' Y' ;
71
71
```
72
72
73
+ ### ** PANDAS**
74
+
75
+ ``` python
76
+ import pandas as pd
77
+
78
+
79
+ def find_products (products : pd.DataFrame) -> pd.DataFrame:
80
+ rs = products[(products[" low_fats" ] == " Y" ) & (products[" recyclable" ] == " Y" )]
81
+ rs = rs[[" product_id" ]]
82
+ return rs
83
+ ```
84
+
73
85
<!-- tabs:end -->
Original file line number Diff line number Diff line change @@ -64,4 +64,16 @@ FROM Products
64
64
WHERE low_fats = ' Y' AND recyclable = ' Y' ;
65
65
```
66
66
67
+ ### ** PANDAS**
68
+
69
+ ``` python
70
+ import pandas as pd
71
+
72
+
73
+ def find_products (products : pd.DataFrame) -> pd.DataFrame:
74
+ rs = products[(products[" low_fats" ] == " Y" ) & (products[" recyclable" ] == " Y" )]
75
+ rs = rs[[" product_id" ]]
76
+ return rs
77
+ ```
78
+
67
79
<!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ import pandas as pd
2
+
3
+
4
+ def find_products (products : pd .DataFrame ) -> pd .DataFrame :
5
+ rs = products [(products ["low_fats" ] == "Y" ) & (products ["recyclable" ] == "Y" )]
6
+ rs = rs [["product_id" ]]
7
+ return rs
You can’t perform that action at this time.
0 commit comments