will help you Hi I have a bunch of data and I need to know how much of each value show up and how often the frequency is only corresponding to the unique value. I used a countif to count the unique value but I wanna know the frequency of the amount of times it shows up. , Change the formula in B1 to, code :
=IF(COUNTIF(A$1:A1, A1)=1, COUNTIF(A:A, A1), TEXT(,))
=COUNTIF(B:B, E1)
Share :

Python Excel number of times a negative and positive number appears (count/frequency)
By : user3363273
Date : March 29 2020, 07:55 AM
it fixes the issue Use two counter variables to track of the total count and number of positives. Set them to 0 in the beginning, and then inside of your loop, increment them by using += 1 whenever you want to add 1. Then test whether the percentage is greater than 0 by stripping out the percentage sign and then converting the string into a number using if float(row[0].strip('%')) > 0. You can change this to >= if you want to include 0 in the "positive" category. code :
totalCount = 0
numberOfPositives = 0
with open('FL%.csv', 'r') as file2:
reader = csv.reader(file2)
reader.next() # this skips the first row of the file
# this iteration will start from the second row of file2.csv
conditionMet = False
for row in reader:
if conditionMet == True:
if float(row[0].strip('%')) > 0: # change > to >= if you want to count 0 as positive
print "FA, 1",row[0],',', ','.join(row[1:5]) # print 1 if positive
numberOfPositives += 1 # add 1 to numberOfPositives only if positive
else:
print "FA, 0",row[0],',', ','.join(row[1:5]) # print 0 if not positive
totalCount += 1 # add 1 to totalCount regardless of sign
conditionMet = False # or break if you know you only need at most one line
if row[1:5] == val1:
conditionMet = True
print 'Total Count =', totalCount
print 'Percentage of Positive numbers =', numberOfPositives * 100./totalCount, '%'

Python count the frequency of each number in a list without any count() functions or without importing anything
By : user3408415
Date : March 29 2020, 07:55 AM
Any of those help Lets say I have List myList = [1, 1, 2, 2, 2, 3] I want to count the frequency of each number in the list and make it into some sort of graph with an output: , A dictbased solution: code :
myList = [1, 1, 2, 2, 2, 3]
output = {}
for item in myList:
if item not in output:
output[item] = 0
output[item] += 1
for number, count in output.iteritems():
print "{0}: {1}".format(number, "X " * count)

Count number of cells that match criteria with nested IF and COUNTIF statements
By : user3098577
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm trying to use an excel formula to count the number of cells in a given range (let's say T132:T134) that match a specific line of text, however cells should only be counted if in a different range (say F132:F134) the corresponding cell in the same row is different from a specific line of text. Here is what I am trying to do: , Didnt you meant to use COUNTIFS?: code :
=COUNTIFS(T132:T134,"<>Not applied",F132:F134,"WN(1)")
=COUNTIFS(T132:T134,"<>Not applied",F132:F134,"*WN(1)*")

Using only an Excel formula, how do I count the number of rows that meet multiple criteria (including a countif)?
By : user3642527
Date : March 29 2020, 07:55 AM

Count past relative number of rows that meet criteria similar to excel's COUNTIF
By : user3670979
Date : March 29 2020, 07:55 AM
will help you I have a stock data csv with the following info , IIUC: code :
df["above"] = pd.DataFrame([df["High"].shift(1)>df["Open"],
df["High"].shift(2)>df["Open"]]).T.sum(axis=1)
# or [df["High"].shift(n)>df["Open"] for n in range(1,5,1)] if you want to generalize the number n
print (df)
Open High Low Close above
0 154.55 155.54 152.90 153.41 2
1 156.82 158.75 155.42 156.76 1
2 150.21 157.44 150.15 156.33 0
3 147.78 149.38 146.88 149.11 0
4 144.25 147.28 143.90 146.27 0
5 142.90 144.05 140.79 143.73 0

