I don't mean to be pedantic, but a list (I am assuming df is a list) requires an int.
(That sentence I wrote about using hashable types need not apply, sorry!)
If you ran that code, you would get this error:
TypeError: list indices must be integers, not list