2
$\begingroup$

I was learning 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 write 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

$\endgroup$
  • $\begingroup$ The 'logistic regression' and 'numpy' tags are irrelevant to this question $\endgroup$ – Itamar Mushkin Jul 12 at 13:45
5
$\begingroup$

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.

| improve this answer | |
$\endgroup$
0
$\begingroup$

use the loc or iloc instead of ix

| improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.