Skip to content

Commit

Permalink
Indexar con DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
CaidevOficial committed Nov 22, 2020
1 parent 684396f commit 7891062
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Practicas/indexar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pandas as pd

file = pd.read_excel("Datos.xlsx")
print(file)

# Se puede dar el nombre de la columna como indice
file2 = pd.read_excel("Datos.xlsx", index_col="Legajo")
print(file2)

# tambien se puede dar el numero de indice
file3 = pd.read_excel("Datos.xlsx", index_col=0)
print(file3)

# esto permite acceder con .loc mediante legajo
print(file2.loc[35679])

0 comments on commit 7891062

Please sign in to comment.