I suspect that X.shape is something like (100,) (because X is a series/vector), so trying to take the second element of the shape is throwing the index error.
I suspect that X.shape is something like (100,) (because X is a series/vector), so trying to take the second element of the shape is throwing the index error.