Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created May 11, 2016 01:42
Show Gist options
  • Save joffilyfe/f308fa5e41367b4ab8e39902005c9e1f to your computer and use it in GitHub Desktop.
Save joffilyfe/f308fa5e41367b4ab8e39902005c9e1f to your computer and use it in GitHub Desktop.
Alterado
# -*- 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