Cloud Stack Ninja

I have found examples of how to remove a column based on all or a threshold but I have not been able to find a solution to my particular problem which is dropping the column if the last row is nan. The reason for this is im using time series data in which the collection of data doesnt all start at the same time which is fine but if I used one of the previous solutions it would remove 95% of the dataset. I do however not want data whose most recent column is nan as it means its defunct.

A B C
nan t x 
1 2 3
x y z
4 nan 6

Returns

A C
nan x
1 3
x z
4 6


Read more here: https://stackoverflow.com/questions/64406954/how-can-i-drop-a-column-if-the-last-row-is-nan

Content Attribution

This content was originally published by JPWilson at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: