Skip to content

Pandas create flag if any condition fails

I have a huge pandas dataframe (actually has 5M rows): My requirement is to create a flag with value as 1 if any of the close dates cls1..5 is < the corresponding open date opn1..5 Example output: for id==2, cls5 < opn5 I want to avoid a loop and run it as fast as possible. There are ~5M rows in

Compare two arrays and print out Index of row in python

I have two arrays A and B I want to compare a couple of the elements of A[:,2:4] with couple elements of B[:,2:4] and print out the rows where they are equal or approximate? Here is my approach just for only A[:,3] How can I do it with both A[:,2] and A[:,3] ? Many thanks Answer I think you are

How to slice hex data?

I have and Hex data in which there are three data present on which I can separate the information contain in the hex data: ID (2 bytes) length of the packet(2 bytes) information from the length of the packet, we come to know how long is the data in this hex data for example hex data = 0001001447364B5F48312E30…