Posts by zoramind • 99 points
6 posts
-
3
votes2
answers97
viewsQ: How to filter rows where columns meet consecutive conditions in Python?
I’m trying to filter lines in which the columns comply with conditions consecutively. That is, if the row has columns with the conditions of after an L/I, the next column has a A/S, then return the…
-
0
votes1
answer30
viewsQ: Can I not use a Trigger correctly in MYSQL?
delimiter // CREATE TRIGGER inventory_update_purchases AFTER INSERT ON purchases FOR EACH ROW BEGIN UPDATE products SET products.inventory = products.inventory + NEW.inventory_bought WHERE…
-
2
votes2
answers258
viewsQ: How to divide the value of an element of a column by delimiter (p.e "|") in pandas?
Let’s say we have the following column: coluna1 ola | 52 hey sou ja da |5 24g The expected output would be: coluna1 ola 52 hey sou ja da 5 24g So far, I’m trying string manipulation with split and…
-
2
votes2
answers41
viewsQ: How to get the X coordinate if the Y condition is met with Numpy?
I created a function that gives me this array as output in which each line corresponds to a point : array([[0.57946528, 2. ], [0.35226154, 0. ], [0.26088698, 0. ], [0.56560726, 1. ], [0.41680759, 1.…
-
0
votes1
answer308
viewsQ: How to create a condition for each dataframe subset in pandas?
I wrote the following in order to create a condition for a subset of a dataframe in which case the cell value is higher than the average of that same subset(in this case the initial subset is small…
-
0
votes0
answers41
viewsQ: How to create a single file that stores the details of the generated information (order)?
have_discount = [] no_discount = [] for each_price in purchases_prices: b = bool_gen(p) if b: have_discount.append(apply_discount(each_price,b)) have_discount = [round(each_price, 2) for each_price…