Hi Members, I am new to Python and Quantconnect. I am trying to fetch quarterly EPS history of stock:

eps_history = qb.GetFundamental(acad.Symbol, "EarningReports.BasicContinuousOperations.ThreeMonths", datetime(2022,3,1), endTime)
107242_1659627804.jpg

As here one EPS value gets repeated for three months I am using :

eps_history_filtered = eps_history.drop_duplicates()

but it is causing a bug in case of earnings where lets say Q1 EPS is 0.5 and Q4 EPS was also 0.5, so it removes one quarter data altogether. 

Hence, I am trying to remove ONLY CONSECUTIVE duplicate values from my dataframe. I tried below approach (mentioned here: solution):

eps_history.loc[eps_history.shift() != eps_history]

but it is throwing below error:

ValueError: Cannot index with multidimensional key

can you please help me on how can I remove only consecutive duplicates in my case. Thanks in advance

Author