AttributeError: 'DataFrame' object has no attribute 'ix'
From the docs:

Warning: Starting in 0.20.0, the .ix indexer is deprecated, in favor
of the more strict .iloc and .loc indexers.

Just use .iloc instead (for positional indexing) or .loc (if using the values of the index).
To read more about loc/ilic/iax/iat, please visit this question on Stack Overflow. To quote the top answer there:

loc: only work on index iloc: work on position ix: You can get data
from dataframe without it being in the index at: get scalar values.
It's a very fast loc iat: Get scalar values. It's a very fast iloc
http://pyciencia.blogspot.com/2015/05/obtener-y-filtrar-datos-de-un-dataframe.html
Note: As of pandas 0.20.0, the .ix indexer is deprecated in favour of
the more strict .iloc and .loc indexers.