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 | |
sales = [('account', ['Jones LLC', 'Alpha Co', 'Blue Inc', 'Mega Corp']), | |
('Total Sales', [150, 200, 75, 300]), | |
('Country', ['US', 'UK', 'US', 'US'])] | |
df = pd.DataFrame.from_items(sales) | |
indices = [True, False, True, True] | |
df[indices] | |
df.Country == 'US' | |
# Faz o mesmo filtro no dataframe df | |
df[df["Country"] == 'US'] |
Fonte: <http://pbpython.com/excel-filter-edit.html> Acessado em 19/06/2016
Deixe um comentário