You have a typo.
It should be:
pd.options.display.float_format = '{:20.2f}'.format
The double period (..
) you had is invalid and so when you try to display the dataframe, you see the error about precision specifier missing.
Minor additional point:
Also, when you are running an install from inside an active notebook, you should be using %pip install
and not an exclamation point along with install commands anymore.
The magic pip command variation was added in 2019 to ensure the install occurs in the environment where the kernel is running that backs the active notebook.
The exclamation point doesn’t do that and can lead to issues. You should be also using %pip list
to see what is installed in the kernel environment that your notebook is using.
See more about the modern %pip install
command here. The second paragraph here goes into more details about why the exclamation point may lead to issues.