-1
Good morning, you guys. I need to solve a statistical problem. But I’m having trouble finding the percentage of the clustered numbers that repeat. Can someone help me? Thanks in advance, follow code:
import os
import math
import numpy as quartil
print("\nOs dados abaixo referem-se ao número de alunos formados no curso técnico da ETEC entre 1991 e 2015."
"\nConstrua a tabela (1) de Distribuição de Frequencias com Freq. Absoluta, Freq. Relativa e Freq. Acumulada."
"\n")
Dados = []
Dados = raw_input('Entre com os dados, separando por espaço: ').split(';')
print(Dados)
Dados.sort()
print("Rol: ", Dados)
var = quartil.array([Dados])
# quartiles
form2 = [9,10,11,12,13,14]
#Achar repeticoes
repeticoes =[]
for i in Dados:
if Dados.count(i) > 1 and i not in repeticoes:
repeticoes.append(i)
#porcentagem = int((repeticoes.count(i)*100)/sum(repeticoes))
#porcentagem.append(i)
print(repeticoes)
#print(porcentagem)
#Achar porcentagem das repeticoes
porcentagem =[]
for i in repeticoes:
if repeticoes.count(i) > 1 and i not in porcentagem:
porc = ((repeticoes.count(i)*100)/sum(int(repeticoes)))
porcentagem.append(porc)
print(porc)
Okay, what’s your question?
– Guilherme Marthe
What are "clustered numbers that repeat" and what percentage would that be?
– Woss
I need to find the percentage equivalent to the numbers that are repeating in the list, example: 9;8;9;7;2;1 9 repeated 2 times 8 1 time 7 1 time 1 time assuming the total is the Qtde the user type.
– Andre Batista
I am trying this way: import os import Math import numpy as quartil print(" in the data below refer to the number of students graduated from the ETEC technical course between 1991 and 2015." " Construct the Frequency Distribution table (1) with Freq. Absolute, Freq. Relative and Freq. Accumulated." " n") Data = [] Data = raw_input('Enter with the data, separating by period and comma: '). split(';') Data.Sort() print(") print('Rol: ', ';'. Join(Data)) Data.Sort() import Collections counter = Collections.Counter(Data) print('N: ', counter.values())
– Andre Batista