I'm creating a Bar Chart with the top 10 highest amounts for each zip code. I've converted the zip code to a string, but in the Bar Chart the x axis is showing as an int 20K, 50K, etc. When checking the astype on zip code it return object type instead of string. I'm confused. How do I show the zip code on the x axis (i.e. '95519', '47905', '44720')?
Data Set is as follows
zip code index
54 95519 1.70
61 81212 1.70
160 47905 1.70
421 57201 1.70
208 1930 1.69
366 44720 1.69
298 28401 1.68
532 82214 1.68
102 30165 1.67
125 50501 1.67
df3 = df2[['zip code', 'index']]
df3 = df3.nlargest(10, 'index')
df3['zip code'] = df3[['zip code']].astype(str)
fig = px.bar(df3, x='zip code', y='index',
hover_data=['zip code', 'index'], color='index',
labels={'index':'INDEX'}, height=400)