BUG: (GH3617) Fix indexing issue with ndim >= 3 with iloc

closes #3617