Created
May 11, 2016 01:42
-
-
Save joffilyfe/f308fa5e41367b4ab8e39902005c9e1f to your computer and use it in GitHub Desktop.
Alterado
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import dataset | |
from scipy import std, var, mean | |
db = dataset.connect('mysql://root@localhost/luciana') | |
table = db['prodeaf'] | |
def calculate(length=None): | |
size = length | |
times = [] | |
words = table.find(word_size=size) | |
qtd = table.count('word_size = %d' % size) | |
for w in words: | |
time = (w['time_translate']-1000)/1000 | |
times.append(time) | |
# Imprimindo a variância e desvio padrão | |
print("Tamanho: {}, QTD: {}, Média: {}, Variância: {}, desvio padrão: {}".format( | |
size, qtd, mean(times), var(times), std(times))) | |
for n in range(1, 20): | |
calculate(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment