Oct-22-2023, 04:25 AM
What im trying to accomplish is to get a few calculation values returned to me.
I need to get a count of registers down by store and if the "%" is greater than "x%" then save that off into a new df
example:
Store 7 has a total of 8 registers, only 1 is down, that is 13% Not required in the df
Store 13 has a total of 15 registers, only 3 are down, but that is 20% which is over the % threshold so this would be added to the df
and so on.
Since the master result set that is saved into a csv contained the IP, Store, Register, Status and Datetime, the master df has everything needed to calculate the % by store.
My test from above using this line:
Cant get my head wrapped around how to use everything together in order to get a df with ONLY records that are over the % threshold. The purpose is that this will need to also be saved into a CSV for our support team to work on or contact the stores to find out what is wrong.
I need to get a count of registers down by store and if the "%" is greater than "x%" then save that off into a new df
example:
Store 7 has a total of 8 registers, only 1 is down, that is 13% Not required in the df
Store 13 has a total of 15 registers, only 3 are down, but that is 20% which is over the % threshold so this would be added to the df
and so on.
Since the master result set that is saved into a csv contained the IP, Store, Register, Status and Datetime, the master df has everything needed to calculate the % by store.
My test from above using this line:
registercntbystore = registerBreakdown.groupby(['Store'])['Register'].count()Gives me a df with all stores and the total count by store.
Cant get my head wrapped around how to use everything together in order to get a df with ONLY records that are over the % threshold. The purpose is that this will need to also be saved into a CSV for our support team to work on or contact the stores to find out what is wrong.