Forgive me if the title is a bit confusing.
Assuming I have test.h5. Below is the result of reading this file withdf.read_hdf('test.h5', 'testdata')
0 1 2 3 4 5 6
0 123 444 111 321 NaN NaN NaN
1 12 234 113 67 21 32 900
3 212 112 543 321 45 NaN NaN
I want to select the last column other than Nan. My expected result is as follows
0 321
1 900
2 45
I also want to highlight the entire column except the last column other than NaN. Perhaps my expected result. Maybe it could be in a numpy array, but I haven't solved any solution yet.
0 1 2 3 4 5 6
0 123 444 111
1 12 234 113 67 21 32
3 212 112 543 321
I searched the Internet and found df.iloc[:, :-1]to read the entire column, but the last one df.iloc[:, -1]to read the last column.
My current result using these two commands looks like this: 1. to read the entire column except the last
0 1 2 3 4 5
0 123 444 111 321 NaN NaN
1 12 234 113 67 21 32
3 212 112 543 321 45 NaN
2.
0 NaN
1 900
2 Nan
: - , pandas ?
.