I have a python dataframe which contains measurements, including positions.
I need to calculate the angle of the direction, which is done by ATAN(Y/X).
However, I need to add the condition of the sign of X and Y to account for the direction of the angle (which quadrant we are in).
So, I want to know how I can run through every row in the dataframe and for the column 'X'and 'Y' I need to : If X is positive and Y is positive then.. If X is positive and Y is negative then.. If X is negative and Y is positive then.. If X is negative and Y is negative then..
I am struggling being able to apply this logic to a dataframe.
Anyone got an idea of how to solve this problem?