Now I’m trying to learn about pandas package in python.
but using rename function, I have some problem.
mushroom = pd.read_csv('./mushroom/agaricus-lepiota.data', header=None)
mushroom = pd.DataFrame(mushroom)
mushroom.rename(columns={'0', 'edibility', '5', 'odor'})
I’m trying to rename column name 0, 5 to ‘edibility’, ‘odor’.
But I got It’s error, not allowed to get callable set function.
How can I fix it?
>Solution :
I can help you.
You seems to miss some grammar on third row.
mushroom.rename(columns={0: ‘edibility’, 5: ‘odor’})
in a short, in case of index rename, don’t use string symbol and don’t forget : grammar.
Good luck.