Python Forum
Filtering Excel Document Data Based On Numerical Values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Filtering Excel Document Data Based On Numerical Values
#6
Try adding na=False and test again.

print(df) # before changes
indexNames = df[~df['Aircraft-combined'].str.contains('D',na=False)].index
df.drop(indexNames , inplace=True)
print(df)#prints all having D and removes remaining rows
df1=pandas.DataFrame(df)
indexNames1 = df1[~df1['Aircraft-combined'].str.match('DL',na=False)].index
df1.drop(indexNames1 , inplace=True)
print(df1)#for the filtered df, now it show for matching word DL
i see line 38-40 of your post have output generated and turned to dataframe, so assign that line 40 to name df to re-process output. Also, you mentioned the output dataframe have column names as Venue BID Date DISPLAY/ Aircraft-combined and you need Aircraft-combined dataframe column re-processed i believe.

print(aircraft.unique().tolist())
df=pd.DataFrame(aircraft)
<<add those lines here, with dataframe columnname and conditions as needed>>



Best Regards,
Sandeep

GANGA SANDEEP KUMAR
Reply


Messages In This Thread
RE: Filtering Excel Document Data Based On Numerical Values - by sandeep_ganga - Jan-03-2020, 05:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy Paste excel files based on the first letters of the file name Viento 2 589 Feb-07-2024, 12:24 PM
Last Post: Viento
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 876 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  Search Excel File with a list of values huzzug 4 1,415 Nov-03-2023, 05:35 PM
Last Post: huzzug
  What data types can I use for default values? Mark17 1 617 Oct-09-2023, 02:07 PM
Last Post: buran
  Copy data from Excel and paste into Discord (Midjourney) Joe_Wright 4 2,312 Jun-06-2023, 05:49 PM
Last Post: rajeshgk
  restrict user input to numerical values MCL169 2 1,052 Apr-08-2023, 05:40 PM
Last Post: MCL169
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,239 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Grouping Data based on 30% bracket purnima1 4 1,300 Mar-10-2023, 07:38 PM
Last Post: deanhystad
Question Inserting Numerical Value to the Element in Optionlist and Printing it into Entry drbilgehanbakirhan 1 902 Jan-30-2023, 05:16 AM
Last Post: deanhystad
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 2,115 Dec-12-2022, 08:22 PM
Last Post: jh67

Forum Jump:

User Panel Messages

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