My df is a square sparse matrix, with the shape:
(3862, 3862)
0 1 ... 3862
0 0.0 0.0 0.0
1 0.0 0.0 0.0
...
3862 0.0 0.0 ... 0.0
And I need to get rid of rows with only 0.0, like so:
df.loc[~(df==0.0).all(axis=1)]
After which I end up with s matrix with shape (3819, 3862)
But I need to keep my matrix square.
So how do I keep track of index of deleted rows, and delete columns from those indexes as well, in order to end up with shape (3819,3819)?