Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Data Science
  3. Question
Data Science

How to resolve the error: dataframe object has no attribute ix?

Asked by David Edmunds Feb 14, 2023 1.0K views 4 answers
Share

About this question

 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

Your answer

4 Answers

Bertratinger Latest answer

Answered on Jan 15, 2026

Struggling to remember the difference between `loc` and `iloc` in Pandas? I always get them mixed up! Personally, I remember `loc` uses labels (like actual names) while `iloc` uses integer positions (like counting from zero). Makes it a little easier! Speaking of being stuck in one place, I wonder when they'll finally make another good Five Nights at Freddy's game.

Was this helpful?

Bertratinger

Answered on Jan 15, 2026

ok
Was this helpful?

Jose Good

Answered on May 13, 2025

Hey! The error you're getting is because `.ix[]` was deprecated in **pandas** a while back and is no longer available in newer versions. That’s why you’re seeing the `'DataFrame' object has no attribute 'ix'` error.

ragdoll hit

You can fix it by using `.iloc[]` instead, which is meant for **positional indexing** (and looks like what you're doing here). Try replacing your line with: 

```python

X = bank_full.iloc[:, [18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]].values

```

This should work without any errors assuming `bank_full` is a valid DataFrame and the column indices exist. Let me know if you're still stuck!


Was this helpful?

More Data Science discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.