dgunning / edgartools

Python library for working with SEC Edgar
MIT License
324 stars 70 forks source link

AMD 10-K income_statement generates error #25

Closed rflores1520 closed 5 months ago

rflores1520 commented 5 months ago

When trying to get the data from the income statement in the latest 10-K form from AMD, I am getting an error. I am using the following commands:

filing = Company("AMD").get_filings(form="10-K").latest(1)
income_statement = filing.obj().income_statement

Traceback (most recent call last): File "", line 1, in File "/opt/homebrew/lib/python3.11/site-packages/edgar/company_reports.py", line 56, in financials return Financials.from_xbrl(xbrl) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/edgar/financials.py", line 301, in from_xbrl balance_sheet = BalanceSheet(xbrl.facts) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/edgar/financials.py", line 174, in init super().init(facts, end_date) File "/opt/homebrew/lib/python3.11/site-packages/edgar/financials.py", line 66, in init self.end_date: str = end_date or self.facts.period_end_date ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/edgar/_xbrl.py", line 126, in period_end_date return self.get_dei('DocumentPeriodEndDate') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/edgar/_xbrl.py", line 122, in get_dei return res.value.item() ^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/pandas/core/base.py", line 418, in item raise ValueError("can only convert an array of size 1 to a Python scalar") ValueError: can only convert an array of size 1 to a Python scalar

dgunning commented 5 months ago

Thanks for reporting this. Testing now .. a fix will be available shortly

dgunning commented 5 months ago

Released a fix in edgartools 2.7.2.

Please upgrade and try again

pip install -U edgartools

dgunning commented 5 months ago

Closed as fixed