Please I don't understant how this syntax works: current_x = X[Y == c].
I've printed out in Ipython some sample with the code (I use pandas here as pd):
In [120]: pd.DataFrame(X)
Out[120]:
0 1 2 3 4 5 6 7 8 9 ... 475 \
0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
1 0.070588 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
2 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
3 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
4 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
5 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
6 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
7 0.596078 0.596078 0.062745 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
8 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
9 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0
476 477 478 479 480 481 482 483 484
0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
[10 rows x 485 columns]
In [121]: pd.DataFrame(Y)
Out[121]:
0
0 1
1 7
2 9
3 4
4 5
5 1
6 1
7 6
8 1
9 1
In [122]: pd.DataFrame(X[Y == 5])
Out[122]:
0 1 2 3 4 5 6 7 8 9 ... 475 476 477 478 \
0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
479 480 481 482 483 484
0 0.0 0.0 0.0 0.0 0.0 0.0
[1 rows x 485 columns]
I don't How X[Y == 5] has come with that result. Please hep-lp