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
#5
Hi GANGA SANDEEP KUMAR,

Many thanks for your help, where do I need to put the Code you show, in my Python Code ?

I put it in the following Order in my Python Code :-

def sorted_string(s):
    return ''.join(sorted(s))

def remove_duplicate_chars(s):
    return ''.join(set(s))

aircraft = aircraft.apply(remove_duplicate_chars)
print(aircraft.unique().tolist())

indexNames = df[~df['A/C'].str.contains('D')].index
df.drop(indexNames , inplace=True)
print(df)#prints all having D and removes remaining rows
df1=pandas.DataFrame(df)
indexNames1 = df1[~df1['A/C'].str.match('DL')].index
df1.drop(indexNames1 , inplace=True)
print(df1)#for the filtered df, now it show for matching word DL

pd.DataFrame(aircraft)
#print(aircraft.shape)
But I get the following Error Traceback :-

Error:
TypeError: bad operand type for unary ~: 'float'
Do you know, what is causing that Error Message ?

Regards

Eddie Winch
Reply


Messages In This Thread
RE: Filtering Excel Document Data Based On Numerical Values - by eddywinch82 - Jan-03-2020, 04:19 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 598 Feb-07-2024, 12:24 PM
Last Post: Viento
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 884 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  Search Excel File with a list of values huzzug 4 1,424 Nov-03-2023, 05:35 PM
Last Post: huzzug
  What data types can I use for default values? Mark17 1 621 Oct-09-2023, 02:07 PM
Last Post: buran
  Copy data from Excel and paste into Discord (Midjourney) Joe_Wright 4 2,342 Jun-06-2023, 05:49 PM
Last Post: rajeshgk
  restrict user input to numerical values MCL169 2 1,057 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,244 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Grouping Data based on 30% bracket purnima1 4 1,315 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 907 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,138 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