Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- print(df_numeros)
- print()
- # Acceso a elementos del DataFrame:
- print(df_numeros['impares'])
- print(df_numeros['impares'][3])
- print()
- # Acceso a una fila de un DataFrame:
- print(df_numeros.loc[1])
- print(df_numeros.loc[1][1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement