Created
January 30, 2018 12:04
-
-
Save Fhernd/dd1274fbb03d0c968bbc61fbcec2b60a to your computer and use it in GitHub Desktop.
Obtener los primeros y últimos datos de un DataFrame en Python.
This file contains 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
import pandas as pd | |
# Definición diccionario: | |
diccionario = {'pares': [0, 2, 4, 6], 'impares': [1, 3, 5, 7]} | |
# Creación DataFrame: | |
df_numeros = pd.DataFrame(diccionario) | |
# Primeros 3 datos: | |
print(df_numeros.head(3)) | |
# Últimos 3 datos: | |
print(df_numeros.tail(3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment