How to get company earning announcements data api?

I want to get real-time earning annoouncements data api. I tried yfinance but it doesn’t work currently. So is there any other replacement api? Most of API need to pay money, But I just want to try for my personal projects so it’s little pressured Does Yahoo Finance no longer offer api? I heard that… Read More How to get company earning announcements data api?

How can I write a function that finds any and all elements of a list that add to a target?

I have been hired to reconcile years of financial records that have quite large discrepancies. The statements are listed in excel and include a name and figure of the transaction (either positive or negative for credit/debit). I’ve been asked to manually read through all the statements to find any combination of values that would add… Read More How can I write a function that finds any and all elements of a list that add to a target?

ValueError: At least one array required as input error when dividing the set

I work on a finance forecasting project I did my preprocessing part but when I try to construct train and test set I got an error I have constructed my DataFrame as alldata = pd.DataFrame({‘Date’:date, ‘S&P 500 Price’:normalised_snp, ‘S&P 500 Open’: normalised_snpopen, ’10 Year Bond Price’: normalised_tybp, ’10 Year Bond Open’: normalised_tybpopen, ‘2 Year Bond… Read More ValueError: At least one array required as input error when dividing the set

writing a if-else-then fucntion

I am trying to write a function to call a function from a package, snippets as below: library(optionstrat) # sameple detla # do not run # calldelta(s,x,sigma,t,r) # putdelta(s,x,sigma,t,r) x=10 sigma=0.25 t=0.25 r=0.05 delta<-function(option_type,stock_price) { if (option_type="c") { delta<-calldelta(s,x,sigma,t,r) } else { delta<-putdelta(s,x,sigma,t,r) } } both calldelta and putdelta are built in functions from optionstrat… Read More writing a if-else-then fucntion

unique value counts of products purchased by the customer in previous year

I am building a function that creates an aggregate table with certain variables developed from df. I think I got most things right, but I am struggling understanding how to count a number of distinct products bought by the customer in previous year. Example of my df: df = pd.DataFrame({‘year’: [2020, 2021, 2021, 2021, 2022],… Read More unique value counts of products purchased by the customer in previous year