EDIT: Error was mine. Get_fundamentals was calling a date reference that should have been undefined, but was defined from previous iterations of my code. Thanks to Dan for picking the mistake.
I'm putting together a notebook to identify stocks where price < Ben Graham's 'net net working capital per share'. (Where NNWC = (cash + accounts receivable * 0.75 + inventory * 0.5 - total liabilities) / shares outstanding)
As a sanity check, I compared the notebook balance sheet output for the stocks I found against the 10Ks and 10Qs available online. I was distressed to find that the fundamentals data from the notebook bore no correspondence to the companies' SEC filings.
You can replicate this. Run the attached notebook. From the dataframe, take the first stock, $AVHI. The dataframe gives its cash as $217m, AR as $10m, inventory as $264m and liabilities as $150m, with 11m shares outstanding.
The company's most recent 10Q, however has cash of $16m, inventory of $630m, AR of $10m, total liabilities of $420m and 22m shares outstanding.
I have replicated this for a couple of the other stocks in the list. I've also checked that the pipeline is pulling the right stock code, in case there are multiple stocks with the same ticker.
Any ideas what is going on here? Makes me seriously question what is going on with the fundamentals data we all rely on!