So I am teaching myself Python and I recently stumbled upon these kinds of code:
plt.scatter(X_pca_2c[:,0], X_pca_2c[:,1], c=iris.target,
alpha=0.8, edgecolors='none')
and np.array(tf_vect.get_feature_names())[tsvd_2c.components_[20].argsort
()[-10:][::-1]]
The functions are too advanced for me at this stage, I know, but I am learning Python arrays now and I wonder how do I interpret the [:,0], [:,1],[-10:][::-1]
here?
I stumbled across such notations a lot and I want to get my understanding right.
I thought it was a simple index at first, but then I realize there is such a thing as [::-1]
too.
Anybody kindly explain the logic behind them? Thanks a lot!!