0

I have a collection of data that needs to be presented as a histogram. When I use numpy.histogram, the values that would go along the x-axis are using Eulers number, which is counterproductive. How do I convert these numbers back to a normal number? The numbers are large, ranging into the tens of millions.

I haven't tried researching how Eulers number is used to try and write my own code to reverse it, but I haven't found anything

from bokeh.plotting import output_file, figure, show
import numpy as np
from excelParser import parseExcelFile #custom method for parsing excel data
from math import exp

rawData = parseExcelFile("histogram-data.xlsx", False) #gets the data
filteredData = []

#filters the data
for key in rawData:
       filteredData.append(rawData[key]['total_revenue'] / 1000000)

histData = np.histogram(filteredData, bins='scott') #calculates histogram data

print(histData[1])

Result:

[1.00000000e-03 2.36480474e+00 4.72860948e+00 7.09241422e+00
 9.45621896e+00 1.18200237e+01 1.41838284e+01 1.65476332e+01
 1.89114379e+01 2.12752427e+01 2.36390474e+01 2.60028521e+01
 2.83666569e+01 3.07304616e+01 3.30942663e+01 3.54580711e+01
 3.78218758e+01 4.01856806e+01 4.25494853e+01 4.49132900e+01
 4.72770948e+01 4.96408995e+01 5.20047043e+01 5.43685090e+01]
Sreekiran A R
  • 3,123
  • 2
  • 20
  • 41

1 Answers1

0

From this answer, include np.set_printoptions(precision=3, suppress=True) before printing.

Rémy
  • 114
  • 11