Comments (6)
Yes I do, you can connect with me via my username "jerbouma".
from financetoolkit.
Seems to be multiple issues, in some cases the length of the financial statements (e.g. cash and balance) differ which is why "LHX" for example won't work.
PeriodIndex(['1986', '1987', '1988', '1989', '1990', '1991', '1992', '1993',
'1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001',
'2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009',
'2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017',
'2018', '2019', '2021', '2021', '2021', '2021', '2022'],
dtype='period[A-DEC]', name='date')
PeriodIndex(['1989', '1990', '1991', '1992', '1993', '1994', '1995', '1996',
'1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004',
'2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012',
'2013', '2014', '2015', '2016', '2017', '2018', '2019', '2021',
'2021', '2021', '2021', '2022'],
dtype='period[A-DEC]', name='date')
This also seems to be one of the reasons you get this error. For example ['AIR', 'AJRD', 'AVAV', 'AXON', 'CUB'] works fine but ['AIR', 'AJRD', 'AVAV', 'AXON', 'CUB', "LHX"] doesn't.
In other cases there is no historical data, like in the case of "CUB". However, this is not an issue unless its the only ticker. All bugs to fix, for sure, but if you could help me out and delve a bit deeper the issue is fixed sooner!
from financetoolkit.
I guess the easiest temporary fix is to remove these tickers as corrupted until a proper fix can be created. I will help for sure. But if you can push an exception fix to the repo then we can work from there so we have common ground to work on.
Additionally do you have discord or something similar, I've got a couple of ideas as how to solve some of these issues. But such brainstorming might work better in a chat format than a github issue
from financetoolkit.
The issue still persists with the latest commit
EDIT: Only persists with the new filing date addition. I've made a new commit that fixes this issue for it as well.
In total i believe this issue to be completely fixed and can be closed
from financetoolkit.
Dear Both, I downloaded the package yesterday and it is shown as 1.1.2. I still get the error with a list of symbols.
I am not enough into python internals to help out, I'm sorry. Just signaling that it seems the bug is still around.
Is there a workaround? Does it depend on the function used? As a start, I would like to get the PE ratio and dividend yield. By the way, it seems to be an awesome project. Just starting with it.
Error traceback:
Traceback (most recent call last):
File ~\anaconda3\envs\py311\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\users\ms\mon drive\aktien und anlage, finanzen, rente\software\findatabase\getntvaluations.py:57
ratios = companies.ratios
File ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\toolkit_controller.py:175 in ratios
self.get_balance_sheet_statement()
File ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\toolkit_controller.py:570 in get_balance_sheet_statement
) = _get_financial_statements(
File ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\models\fundamentals_model.py:111 in get_financial_statements
financial_statement_total = pd.concat(financial_statement_dict, axis=0)
File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\reshape\concat.py:385 in concat
return op.get_result()
File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\reshape\concat.py:612 in get_result
indexers[ax] = obj_labels.get_indexer(new_labels)
File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\indexes\base.py:3732 in get_indexer
raise InvalidIndexError(self._requires_unique_msg)
InvalidIndexError: Reindexing only valid with uniquely valued Index objects
Code used including list of symbols, I erased my key:
import pandas as pd
import numpy as np
from financetoolkit import Toolkit
API_KEY = "something"
Initialize the Toolkit with company tickers
#They can be copied from the listing formula in copy sheet in NT8 export file
companies = Toolkit(
["AAP", "ADM", "ADP", "APA", "ARE", "BXP", "CE", "CF", "CHTR", "CINF", "CMCSA", "CME", "COP", "CTLT", "CVX", "DD", "DOW", "DVN", "EOG", "FANG", "FCX", "FFIV", "FITB", "GNRC", "HBAN", "HES", "HUM", "IEX", "ILMN", "IPGP", "JBHT", "JPM", "LIN", "LNC", "LYB", "MAR", "MET", "MKC", "MOS", "MPC", "MRO", "MTB", "OKE", "OXY", "PAYX", "PNC", "PNR", "POOL", "PRGO", "PRU", "PSX", "PXD", "RF", "STT", "TAP", "TSCO", "TSN", "VLO", "WAB", "WRK"],
api_key=API_KEY, start_date="2000-01-01"
)
#Including Sector:
companies.get_profile()
ratios = companies.ratios
ratios.collect_valuation_ratios()
from financetoolkit.
Dear Both, I downloaded the package yesterday and it is shown as 1.1.2. I still get the error with a list of symbols.
I am not enough into python internals to help out, I'm sorry. Just signaling that it seems the bug is still around.
Is there a workaround? Does it depend on the function used? As a start, I would like to get the PE ratio and dividend yield. By the way, it seems to be an awesome project. Just starting with it.Error traceback:
Traceback (most recent call last):File ~\anaconda3\envs\py311\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)File c:\users\ms\mon drive\aktien und anlage, finanzen, rente\software\findatabase\getntvaluations.py:57
ratios = companies.ratiosFile ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\toolkit_controller.py:175 in ratios
self.get_balance_sheet_statement()File ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\toolkit_controller.py:570 in get_balance_sheet_statement
) = _get_financial_statements(File ~\anaconda3\envs\py311\Lib\site-packages\financetoolkit\base\models\fundamentals_model.py:111 in get_financial_statements
financial_statement_total = pd.concat(financial_statement_dict, axis=0)File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\reshape\concat.py:385 in concat
return op.get_result()File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\reshape\concat.py:612 in get_result
indexers[ax] = obj_labels.get_indexer(new_labels)File ~\anaconda3\envs\py311\Lib\site-packages\pandas\core\indexes\base.py:3732 in get_indexer
raise InvalidIndexError(self._requires_unique_msg)InvalidIndexError: Reindexing only valid with uniquely valued Index objects
Code used including list of symbols, I erased my key:
import pandas as pd
import numpy as npfrom financetoolkit import Toolkit
API_KEY = "something"
Initialize the Toolkit with company tickers
#They can be copied from the listing formula in copy sheet in NT8 export file
companies = Toolkit(
["AAP", "ADM", "ADP", "APA", "ARE", "BXP", "CE", "CF", "CHTR", "CINF", "CMCSA", "CME", "COP", "CTLT", "CVX", "DD", "DOW", "DVN", "EOG", "FANG", "FCX", "FFIV", "FITB", "GNRC", "HBAN", "HES", "HUM", "IEX", "ILMN", "IPGP", "JBHT", "JPM", "LIN", "LNC", "LYB", "MAR", "MET", "MKC", "MOS", "MPC", "MRO", "MTB", "OKE", "OXY", "PAYX", "PNC", "PNR", "POOL", "PRGO", "PRU", "PSX", "PXD", "RF", "STT", "TAP", "TSCO", "TSN", "VLO", "WAB", "WRK"],
api_key=API_KEY, start_date="2000-01-01"
)
#Including Sector:
companies.get_profile()ratios = companies.ratios
ratios.collect_valuation_ratios()
Hi! This is an older version of the package and meant for Python versions under 3.10. Please update your Python version and update to the latest release (v1.2.0) which has this issue fixed.
EDIT: actually, I believe just updating to the latest version should fix your issue.
from financetoolkit.
Related Issues (20)
- Missing Symbols in FinanceDatabase available in FinancialToolkit HOT 1
- Growth, value, quality stocks info ? HOT 1
- [IMPROVE] Proxy availability HOT 1
- [IMPROVE] Add TQDM/Progress bar on tickers fetched HOT 1
- ValueError: Value is too big! HOT 5
- Is it possible to get sector, industry group info of stock ? HOT 1
- Clarification on Calculating Excess Returns in Non-US Markets with Different Currencies HOT 3
- [BUG] IndexingError: Too many indexers HOT 1
- [IMPROVE] NaN values in PVGO HOT 7
- [BUG] Error using convert_currency=True for old financial data HOT 6
- [FR] Adding calculation of resistance levels HOT 4
- [Bugs] small error in get_interest_debt_per_share(..) HOT 2
- [BUG]: serious bug, missing Estimates dates HOT 2
- [BUG]: income statement false if trailing for Weighted Average Shares HOT 2
- fixed_income is not working anymore HOT 1
- get_historical_data() method error HOT 3
- ratios.get_reinvestment_rate(trailing=4) not working HOT 1
- [BUG] Try to convert Currency when eod and statement are same currency HOT 9
- getting macroeconomic data HOT 3
- [IMPROVE] No data found for the following tickers: AAPL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from financetoolkit.