Skip to content

Instantly share code, notes, and snippets.

@marciopalheta
Created May 22, 2017 22:23
Show Gist options
  • Save marciopalheta/002804f63e5186c56f83b2edd869f4d4 to your computer and use it in GitHub Desktop.
Save marciopalheta/002804f63e5186c56f83b2edd869f4d4 to your computer and use it in GitHub Desktop.
import numpy as np
import pydataset
#Criação de um dicionário com dados de alunos
alunos_dic = {
'nome': ['João', 'Maria', 'José', np.nan, 'Pedro', 'Judas', 'Tiago'],
'sexo': ['M', 'F', 'M', np.nan, 'M', 'M', np.nan],
'idade': [14, 13, np.nan, np.nan, 15, 13, 14],
'nota': [4, 10, 7, np.nan, 8, 9, 7]
}
# conversão do dicionário para DataFrame
alunos = pd.DataFrame(alunos_dic)
alunos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment