'How to format a number from thousands to K style in plotly
I want to change the format of y-axis from thousands to thousands in K format in plotly python. This is part of the data.
df = pd.DataFrame({"country":["USA","Germany","France","Norway","Italy"],
"GDP":[654351.55,592802.56,363693.83,180218.17,223992.0],
"Date":['2018-02-28','2018-03-28','2018-01-28','2018-06-28','2018-07-28']})
Solution 1:[1]
For newcomers, if you find your y-axis tick format is in a weird format like mine, please make sure from the type of the column (GDP in my case). In my case, it was string because I converted a numpy array of 3 columns to dataframe and I did not pay attention to the fact that numpy array convert all values to string including GDP.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

