messari-python-api icon indicating copy to clipboard operation
messari-python-api copied to clipboard

'dict' object has no attribute 'head'

Open soroushosanlou opened this issue 3 years ago • 4 comments

Issues it says "'dict' object has no attribute 'head'" could you please help me?

soroushosanlou avatar Jan 31 '22 11:01 soroushosanlou

It is returning dict instead of a dataframe. You can covert this dictionary to dataframe as follows: markets_df = messari.get_all_markets() markets_df = pd.DataFrame(markets_df['data']) markets_df.head()

pallavimitra avatar Feb 12 '22 10:02 pallavimitra

seems like this is fixed..? I just tried, it seems to return DF

xyang-algotune avatar Mar 30 '22 23:03 xyang-algotune

I had this same issue and was able to fix just now. Originally I had installed this with pip install messari — then I got this error (and others)

However, the above code works as intended, returning a dataframe, when I install via pip install git+https://github.com/messari/messari-python-api.git.

So my guess is that it's an older version being installed with pip install messari?

devin-black avatar Apr 09 '22 20:04 devin-black

I had the same experience; when I used pip3 install messari, it downloaded the 0.0.1 version of the package; I used pip3 install messari --upgrade and it downloaded the newest 1.0 version.

allenvalter avatar Oct 05 '22 18:10 allenvalter