Python Forum
Need Help With Filtering Data For Excel Files Using Pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Help With Filtering Data For Excel Files Using Pandas
#9
I typed the following :-

df['BID'].value_counts()


To get all occurances of a particular BID Number. What do I type, so that all Rows, With a Bid Number value_count of 1 I remove leaving the remaining rows, i.e. only the Duplicates ?

This is my latest Python Code :-

import pandas as pd
  
xls = pd.ExcelFile(r'C:\Users\Edward\Desktop\BBMF Schedules And Master Forum Thread Texts\BBMF Display Schedule 2009.xls')
  
data = pd.read_excel(xls, sheet_name="Sheet1")
    
pd.options.display.max_rows = 1000

df = pd.DataFrame(data, columns= ['Venue','A/C','DISPLAY/','Date','BID'])
  
df[(df['Venue'].str.contains('[a-zA-Z]') & (df['DISPLAY/'].str.contains('DISPLAY') & df['A/C'].str.contains("DHS|DAK|HS|SPIT")) & (df['A/C'] != 'LHS') & (df['A/C'] != 'LANC'))]
Reply


Messages In This Thread
RE: Need Help With Filtering Data For Excel Files Using Pandas - by eddywinch82 - Aug-05-2019, 07:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Parsing "aTimeLogger" Android app data to graphs using pandas Drone4four 6 576 Yesterday, 11:12 AM
Last Post: Drone4four
  Pandas keep existing format of Excel AlphaInc 2 1,584 Jan-11-2024, 03:44 AM
Last Post: plonkarchivist
  Grouping in pandas/multi-index data frame Aleqsie 3 837 Jan-06-2024, 03:55 PM
Last Post: deanhystad
  Filtering Data Frame, with another value NewBiee 9 1,599 Aug-21-2023, 10:53 AM
Last Post: NewBiee
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,122 Jan-09-2023, 08:14 PM
Last Post: PY_ALM
Smile How to further boost the data read write speed using pandas tjk9501 1 1,331 Nov-14-2022, 01:46 PM
Last Post: jefsummers
  Pandas Dataframe Filtering based on rows mvdlm 0 1,522 Apr-02-2022, 06:39 PM
Last Post: mvdlm
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,939 Feb-13-2022, 01:19 PM
Last Post: jefsummers
  Help with poorly formatted excel data armitron121 1 1,783 Jan-13-2022, 07:31 AM
Last Post: paul18fr
Question Sorting data with pandas TheZaind 4 2,448 Nov-22-2021, 07:33 PM
Last Post: aserian

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020