Advertisement
Fhernd

primeros-ultimos-datos.py

Jan 30th, 2018
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. # Definición diccionario:
  4. diccionario = {'pares': [0, 2, 4, 6], 'impares': [1, 3, 5, 7]}
  5.  
  6. # Creación DataFrame:
  7. df_numeros = pd.DataFrame(diccionario)
  8.  
  9. # Primeros 3 datos:
  10. print(df_numeros.head(3))
  11.  
  12. # Últimos 3 datos:
  13. print(df_numeros.tail(3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement