In [318]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats

In [319]:
nomes = []
with open("sorteio", "r") as file:
    nomes = file.readlines()

In [320]:
qtd = len(nomes)

In [357]:
nomes[np.random.randint(0, qtd, 1)]


/usr/local/lib/python3.5/dist-packages/ipykernel/__main__.py:2: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future
  from ipykernel import kernelapp as app
Out[357]:
'Mariana Picoli \n'

In [326]:
nomes


Out[326]:
['Filipi Sanguino\n',
 'Caue Ferreira\n',
 'Caterine Souza\n',
 'Thandryus\n',
 'Jefferson Viana\n',
 'Priscila Mendes\n',
 'Ricardo Paterno\n',
 'Alessandro Davi\n',
 'Bruno Chagas\n',
 'Franklin Rodrigues\n',
 'Carlos Otobone\n',
 'Camila Fernandes\n',
 'Daniel Cantuaria\n',
 'Eli Romero\n',
 'MFernanda\n',
 'Leonardo Vieira Costa\n',
 'Edi Carlos Sousa\n',
 'Agatha Nogueira\n',
 'Amós Alexander\n',
 'Moisés Medeiros de Oliveira\n',
 'Bruno Morais Javarez\n',
 'Caique Araujo\n',
 'César Visini\n',
 'João Pedro Ghidini\n',
 'Rafael Bitencourt\n',
 'John Michael\n',
 'Ali Hijazi\n',
 'Nelson Oliveira Labela\n',
 'Yuri Cordeiro\n',
 'Pedro Hanuari\n',
 'Carlos Eduardo Magalhães\n',
 'Rodrigo Dias\n',
 'Victor Santoro\n',
 'Amanda Souza\n',
 'Eduardo Soci\n',
 'Edio Cerati\n',
 'Leonardo Aquino\n',
 'Daniel Truga\n',
 'João Lucas Gonçalves\n',
 'Daniel Teixeira\n',
 'Bruno Nascimento\n',
 'Mariana Picoli \n',
 'Matheus Muniz\n',
 'Bruna Bazaluk Videira\n',
 'Bárbara Garcia\n',
 'Matheus Getaruck\n',
 'Renan Hirayama\n',
 'Xavier Junior\n',
 'Felipe Abdalla\n',
 'Felipe Soeiro\n',
 'Cesar Augusto Bomgiovani\n',
 'Leonardo Reis\n',
 'Patricia Oliveira\n',
 'Lorraine Mendes\n',
 'Luan Lima\n',
 'Leonardo Alakija\n',
 'Geeh\n',
 'Ramon Ramos\n',
 'Vinicius Teixeira\n',
 'Osvaldo Amorim\n',
 'Mayara Cristina\n',
 'William de Castilho\n',
 'Leandro Cardoso Guedes\n',
 'Breno Agatão Garcia\n',
 'Fabio\n',
 'Marcos Cordeiro\n',
 'Vitor Cabelo\n',
 'Iago Fernandes\n',
 'Luane Khan\n',
 'Gustavo de Paula Peri\n',
 'Gabriela Camila\n',
 'Theo Lapido\n',
 'Dindara Galvão\n']

In [327]:
dat = np.random.randint(0, qtd, size=1e7)


/usr/local/lib/python3.5/dist-packages/ipykernel/__main__.py:1: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  if __name__ == '__main__':

In [328]:
plt.hist(dat, bins=72)
plt.xlim(0, 71)
plt.show()



In [226]:
nomes[stats.mode(dat)[0]]


/usr/local/lib/python3.5/dist-packages/ipykernel/__main__.py:1: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future
  if __name__ == '__main__':
Out[226]:
'Bruna Bazaluk Videira\n'

In [108]:
winner


Out[108]:
71

In [ ]: