No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hello, I am trying to sum lists if a condition is met, not working, not sure why, I end up with PN=[0,0,0,0,0,0,0,0] which is it's initial condition and should be PN=[1,1,1,1,0,1,1,1] as PN0 and PN1 satisfy the condition PNi.count(1)<2, so PN+PN0+PN1 = [1,1,1,1,0,1,1,1]. Thanks. [CODE]>>> PN0=[0,0,1,1,0,1,0,1] PN1=[1,1,0,0,0,0,1,0] PN2=[0,0,0,0,1,0,0,0] PN=[0,0,0,0,0,0,0,0] NULL==[0,0,0,0,0,0,0,0] … |
|
Hello, can someone please tell me why this simple if ststement dose not run [CODE]>>> VList=[0,0,1,0,1,1,0,0] >>> if VList.count(1) < 5: print('Yes') else: print('No')[/CODE] The VList.count(1)works so not sure what is wrong, but I think that's were the code is crashing. Thanks |
|
Hello, If say I have 5 variables: v1=3 v2=1 v3=7 v4=6 v5=5 and two lists made from these L1=[v1, v2, v3, v4, v5] , L2= [3, 1, 7, 6, 5] and I sort on L2, so that I have, L2=L2.sort()=[1, 3, 5, 6, 7] Is there a way to sort … |
|
Hello, the code I am posting sorts a pivot table but there can be only one statistic per row e.g Mean or Count. I often have multiple statistics per row e.g Mean, Mode etc... . I often have to generate multiple, long, pivot tables and to sort them manually is … |