messari / messari-python-api

Python client for Messari's API
MIT License
89 stars 15 forks source link

'dict' object has no attribute 'head' #16

Open soroushosanlou opened 2 years ago

soroushosanlou commented 2 years ago

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

pallavimitra commented 2 years ago

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()

xyang-algotune commented 2 years ago

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

devin-black commented 2 years ago

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?

allenvalter commented 2 years ago

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.