reset_index() is a DataFrame method, therefore nps must be a DataFrame so this method can be called. Is nps a DataFrame? Can you share the code you used to create it?
Also, don’t forget, when you would like to run matplotlib in Jupyter Notebook:
use the inline magic: “%matplotlib inline”. This command works only there because Jupyter uses iPython instead of the regular python used throughout the missions.