Counting tag -change dict to df

I try to rename the column after i converted the dictionary to dataframe, but there is an error showing…my code is wrong?

Screen Link:

My Code:

tag_count.rename(columns={0: "Count"}, inplace=True)

What actually happened:

TypeError: 'numpy.ndarray' object is not callable

hi @candiceliu93

Tried your code with the dictionary I created, the code worked and gave the first 10 rows.

have you tried breaking the code, and printing each step?

I put the code on a separate box and run all rows, and it works. But if I put all code into one box. it does not work.

Interesting your code works for me straight away. Perhaps issue with the way ipython configured…

For those interested I have done it in one line:

df_tag_count = pd.DataFrame.from_dict(tag_count, orient=‘index’, columns=[‘count’])