tjefferies / pymetalog

Public repo for the pymetalog project
MIT License
37 stars 3 forks source link

Solution for a_vector.py line 215 - 'numpy.ndarray' object has no attribute 'values' #16

Open NixonZ opened 2 years ago

NixonZ commented 2 years ago

When >100 data points are used, the variable df_x is a dictionary with 2 keys, df_x['x'] and df_x['probs'] https://github.com/tjefferies/pymetalog/blob/0cd332b132eb3c9117a827088f7082e346cb77d8/pymetalog/support.py#L52-L55

Whereas, when using direct cdf data (with 'probs' argument) or using <100 data points, it is a pandas data frame, https://github.com/tjefferies/pymetalog/blob/0cd332b132eb3c9117a827088f7082e346cb77d8/pymetalog/metalog.py#L216-L222

https://github.com/tjefferies/pymetalog/blob/0cd332b132eb3c9117a827088f7082e346cb77d8/pymetalog/support.py#L26-L31

Changing #L 52 from, https://github.com/tjefferies/pymetalog/blob/0cd332b132eb3c9117a827088f7082e346cb77d8/pymetalog/support.py#L52 to df_x = pd.Dataframe()

should solve the error.

aleewen commented 1 year ago

This works, but now data with 99 samples results in a completely different plot than data with 101 samples. There's something else that isn't right.