Indexerror Invalid Index To Scalar Variable Python Definition