I am plotting data in a seaborn barplot. I want to label something from my pandas dataframe into the bar. I have gotten the labeling part figured out (see code to replicate below), but I still want to convert it to scientific notation.
import pandas as pd
d = {'name': ['experiment1','experiment2'], 'reads': [15000,12000], 'positiveEvents': [40,60]}
df = pd.DataFrame(d)
df['proportianPositive'] = df['positiveEvents']/df['reads']
p = sns.barplot(data=df,x='name',y='positiveEvents', palette = 'colorblind', alpha =0.8)
p.bar_label(p.containers[0],labels=df.proportianPositive, padding = -50, rotation=90)
plt.show()
Result:
How do I convert df.proportianPositive to scientific notation so that it will show up on my barplot?