Closed henrikef closed 3 years ago
I have tracked down the problem to be a pandas issue: Example:
import pandas as pd
pd.options.display.float_format = '{:.6g}'.format
my_dictionary = {'Pippo': {'value':1.4e-10,'toto':1e-20,'gigi':2}}
df = pd.DataFrame.from_dict(my_dictionary)
print (df)
my_dictionary = {'Pippo': {'value':1.4e-10,'toto':1e-20,'gigi':'2'}}
df = pd.DataFrame.from_dict(my_dictionary)
print (df)
results in
Pippo
gigi 2
toto 1e-20
value 1.4e-10
Pippo
gigi 2
toto 1e-2
value 1.4e-1
The first print (where all the values in the dictionary are numbers, including gigi that is equal to the number 2) returns the correct values, while the second print, where now gigi is a string '2', prints out the wrong format.
https://github.com/pandas-dev/pandas/issues
They only have 3529 open issues right now 😭
This issue has become stale. Is there an update? We will close in 15 days
Minor issue, but
model.display()
by default displays small flux values as 0 instead of switching to scientific notation. I thought I could fix that in the general display options for data frames, but that leads to trailing zeroes in the exponent being cut off (see below). Any ideas if this is a bug in pandas or astromodels?Example:
Relevant parts of the output:
First display (note that the values are all 0):
Second display (note that the two values ending in
e1
should bee10
):Printing the two values in question directly: