Wrote an article
https://itsmycode.com/typeerror-only-integer-scalar-arrays-can-be-converted-to-a-scalar-index/