Jul-28-2020, 08:34 PM
Hi how filter number in column CFOP that which start with number 1xxx
I have a column CFOP with number type like this (Dtype int64)
CFOP
5927
5403
5102
6152
6209
1102
2353
1353
1556
2923
2102
1411
1202
2152
1949
6202
But I need get number that start 1
I have a column CFOP with number type like this (Dtype int64)
CFOP
5927
5403
5102
6152
6209
1102
2353
1353
1556
2923
2102
1411
1202
2152
1949
6202
But I need get number that start 1
import pandas as pd cols = ['CFOP', 'QUANTIDADE', 'VC', 'BC'] xl = pd.read_excel(r'C:\Users\alexandre.goncalves\Documents\Projetos_Python\Fat_3.xlsx', sheet_name='geral', usecols=cols) # How to filter data in column CFOP which start with number 1, I try this print(xl.loc[xl['CFOP'].isin([1102,1353,1556,1411,1202,1949])])