How to resolve the error: dataframe object has no attribute ix?
I was learning a Classification-based collaboration system and while running the code I faced the error AttributeError: 'DataFrame' object has no attribute 'ix'. Here is the code I have written until now. X=bank_full.ix[:,(18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)].values
To resolve the error: dataframe object has no attribute ix:
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 stric .iloc and .loc indexers.