I am utilizing the following duty to identify near- and also next-term options to replicate the VIX index. In which method it offers me the error message when I try to use the role onto mine dataframe.

You are watching: Zero-size array to reduction operation minimum which has no identity

Here a link to the full error code complete Error Code.

What can be the factor that it gives mit this worth error? together you can see I checked if the code works until I use the role and yes, it does. Other is wrong with the role f but I have no clue...

def f(group): job = np.array(group<'Days'>) sigma2 = np.array(group<'sigma2'>) if days.min() T1>.min() sigma_T1 = sigma2<0> sigma_T2 = sigma2<0> return pd.DataFrame(<'T1' : T1, 'T2' : T2, 'sigma2_T1' : sigma_T1, 'sigma2_T2' : sigma_T2>) two_sigmas = sigma2.reset_index().groupby('Date').apply(f)####.groupby(level = 'Date').first() two_sigmas.head()
8 comments
share
save
hide
report
100% Upvoted
Log in or authorize up to leave a comment
Log InSign Up
Sort by: best

*

level 1
· 10m
From the error message, it seems that days T1> is empty (so days have to only have aspects with the very same value). Have actually you confirm what days and T1 are before that line?


2
Reply
Share
ReportSave
level 2
OP · 10m

I'm pretty brand-new to coding and Python so excuse me because that asking...

but job is firstly characterized within the function. So if I put the hashtag prior to .apply(f), days is actually not defined, yet.

See more: The Book Of Mormon Sal Tlay Ka Siti, The Book Of Mormon

How have the right to I figure out why days T1> is empty?


1
Reply
Share
ReportSave
Continue this thread 


*

r/learnpython
Subtacoemojishirt.com because that posting questions and asking for general advice about your python code.
571k
Members


652

Online


Created Oct 2, 2009
Join
*
*
*
*

*

Top posts february 11th 2021Top write-ups of february, 2021Top articles 2021
helptacoemojishirt.com coinstacoemojishirt.com premiumtacoemojishirt.com gifts
aboutcareerspressadvertiseblogTermsContent policyPrivacy policyMod policy
Back to Top