Created
April 29, 2019 16:51
-
-
Save MoisesTedeschi/ea8c52211a87f3d13cd75e076ce50ce0 to your computer and use it in GitHub Desktop.
Pegando valor pelo índice usando Pandas e loc.
This file contains hidden or 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 | |
| dataset = pd.read_csv('exemplo.csv') | |
| # Testando dataset | |
| dataset.head() | |
| # Chamar uma linha pelo seu índice | |
| dataset.loc[5] | |
| # Setando um índice para buscar uma string qualquer | |
| dataset2 = dataset.set_index('Player') | |
| # Testando novo dataset | |
| dataset2.head() | |
| # Pegando valor pelo seu "índice" | |
| dataset2.loc['Justise Winslow'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment