2

I am facing an issue here. I have a Dataframe column whose values I need to put as value+% i.e. say 10%, 15% etc.

However, I am able to put the values as string type in the excel sheet after writing but while I plot the graph, the value is being considered as a string and hence the chart is not getting generated.

I need to paste the value with the % symbol in the concerned column as well as I need to plot the graph while writing to the excel sheet.

Any solution for this??

Thanks in advance.

  • 1
    related and probable dupe: https://stackoverflow.com/questions/31357611/format-y-axis-as-percent – EdChum Aug 08 '17 at 10:50

1 Answers1

0

For writing the value in excel you can use

str(value) + '%'

While plotting graph access the values by slicing the last character(%) and convert it to number by using eval function.

eval(value[:-1])
SunilThorat
  • 1,672
  • 2
  • 13
  • 15