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
#1
Hi There,

I am trying to filter Data, for Excel Files in Pandas. Based on the Column Value i.e. String Value.

I managed to get, some data displayed before, but have gone wrong somewhere. As only the Chosen Column Names display, now when I run the Code, in Python 3.7.

Here is the Website Link to the XLS File, if someone could download the File, and tell me where I am going wrong :-

http://web.archive.org/web/2009080423493...6AA506.xls

Here is my latest Code :-

import pandas as pd

data = pd.read_excel (r'C:\Users\Edward\Desktop\BBMF Schedules And Master Forum Thread Texts\BBMF Display Schedule 2009.xls')

df = pd.DataFrame(data, columns= ['Venue','A/C','DISPLAY/','Date'])

df[(df['Venue'].str.contains('[a-zA-Z]') & df['A/C'].str.contains('DHS')) & (df['A/C'].str.contains('DSS')) & (df['A/C'].str.contains('DAK')) & (df['A/C'].str.contains('HS')) & (df['A/C'] != 'L') & (df['DISPLAY/'].str.contains('DISPLAY'))]
As you can see from the Code, I want data to display, based on Column Values.

Any help would be much appreciated.

Regards

Eddie
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas keep existing format of Excel AlphaInc 2 1,067 Jan-11-2024, 03:44 AM
Last Post: plonkarchivist
  Grouping in pandas/multi-index data frame Aleqsie 3 688 Jan-06-2024, 03:55 PM
Last Post: deanhystad
  Filtering Data Frame, with another value NewBiee 9 1,413 Aug-21-2023, 10:53 AM
Last Post: NewBiee
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,052 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,270 Nov-14-2022, 01:46 PM
Last Post: jefsummers
  Pandas Dataframe Filtering based on rows mvdlm 0 1,446 Apr-02-2022, 06:39 PM
Last Post: mvdlm
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,872 Feb-13-2022, 01:19 PM
Last Post: jefsummers
  Help with poorly formatted excel data armitron121 1 1,730 Jan-13-2022, 07:31 AM
Last Post: paul18fr
Question Sorting data with pandas TheZaind 4 2,355 Nov-22-2021, 07:33 PM
Last Post: aserian
  Exporting data frame to excel dyerlee91 0 1,632 Oct-05-2021, 11:34 AM
Last Post: dyerlee91

Forum Jump:

User Panel Messages

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