Python Forum
Remove Rows based on condition
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Rows based on condition
#1
Hello,
I am totally new to python and not sure this is the correct place to ask a question.
I want to remove receipts which have opposite values (Y vs N,1 vs -1 etc.).if each receipt's row has opposite row. I.e. if also will be row 500.2 (with any content) - receipt 500 will not be removed.
Does any suggest me the best way to do with python script? I am a power bi developer and power bi accept python script.
Please see below link for data set and expected result.

<a href="http://tinypic.com?ref=2w1w9d4" target="_blank"><img src="http://i67.tinypic.com/2w1w9d4.png" border="0" alt="Image and video hosting by TinyPic"></a>

[Image: 2w1w9d4.png]
Reply
#2
for your post, you need to provide:
  • What you have tried so far (show best attempt code)
  • where the data is coming from, and how it's being displayed
  • Your operating system, python version and what packages are being used.
  • Anything else needed to duplicate starting point
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  unable to remove all elements from list based on a condition sg_python 3 373 Jan-27-2024, 04:03 PM
Last Post: deanhystad
  Sent email based on if condition stewietopg 1 804 Mar-15-2023, 08:54 AM
Last Post: menator01
  create new column based on condition arvin 12 2,132 Dec-13-2022, 04:53 PM
Last Post: jefsummers
  Deleting rows based on cell value in Excel azizrasul 11 2,475 Oct-19-2022, 02:38 AM
Last Post: azizrasul
  How to assign a value to pandas dataframe column rows based on a condition klllmmm 0 797 Sep-08-2022, 06:32 AM
Last Post: klllmmm
  select Eof extension files based on text list of filenames with if condition RolanRoll 1 1,475 Apr-04-2022, 09:29 PM
Last Post: Larz60+
  Remove if similar values available based on two columns klllmmm 1 1,313 Feb-20-2022, 06:55 PM
Last Post: Larz60+
  The code I have written removes the desired number of rows, but wrong rows Jdesi1983 0 1,599 Dec-08-2021, 04:42 AM
Last Post: Jdesi1983
  Calculate next rows based on previous values of array divon 0 1,716 Nov-23-2021, 04:44 AM
Last Post: divon
  How to map two data frames based on multiple condition SriRajesh 0 1,448 Oct-27-2021, 02:43 PM
Last Post: SriRajesh

Forum Jump:

User Panel Messages

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