I'm trying to get 3 days of history for all the subscribed assets using the 'History(3)'  method in Python. I was expecting a Dataframe in return but got a class 'QuantConnect.Util.1, Culture=neutral, PublicKeyToken=null' instead. In the research environment this indeed does return a dataframe, however in an algorithm it seems to not.  What do I need to do to ensure a dataframe is returned?

My test code is simple.

data_df = context.History(3) context.Log("history is: {}".format(type(data_df)))

The logs show.

history is: <class 'QuantConnect.Util.1, Culture=neutral, PublicKeyToken=null]]'>

The problem is when I try to do something like

my_closes = data_df.close

I get an error.

Python.Runtime.PythonException: AttributeError : '1, Culture=neutral, PublicKeyToken=null]]' object has no attribute 'close'

That code should work and return the 'close' column from the dataframe. This works in the research environment. Is there something I need to maybe import?

Author