kashish18
(Kashish Mukheja)
December 2, 2018, 8:37pm
1
On running the code :-
df_raw.UsageBand.cat.set_categories([‘High’, ‘Medium’, ‘Low’], ordered=True, inplace=True)
AttributeError Traceback (most recent call last)
in ()
----> 1 df_raw.UsageBand.cat.set_categories([‘High’, ‘Medium’, ‘Low’], ordered=True, inplace=True)
/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in getattr (self, name)
3612 if name in self._info_axis:
3613 return self[name]
-> 3614 return object.getattribute (self, name)
3615
3616 def setattr (self, name, value):
AttributeError: 'DataFrame’ object has no attribute 'UsageBand’
Pls Help!
1 Like
monkeyflute
(LOREN T HOPKINS)
December 16, 2018, 12:25am
3
What was the mistake please. I’m having the same problem
monkeyflute
(LOREN T HOPKINS)
December 16, 2018, 1:07am
4
Don’t worry. Figured it out. Cheers
rijul
January 11, 2019, 7:10am
6
@kashish18 Hey, I am also getting the similar error can you point me towards a mistake.
rijul
February 7, 2019, 5:04am
8
@berlinwar Hey, UsageBand is a feature/column in Bulldozers data set only.
Jeremy in this code is just taking an example of UsageBand feature to show how to check different categories in the categorical variable and how to arrange them in a particular order which makes more sense.
I hope this helps.
Took me time, but I found this as well, and it does definitely help. Thanks