Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use dict.get() to safely access key in Holders #2013

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

ericpien
Copy link
Contributor

@ericpien ericpien commented Aug 6, 2024

Sample Checks:

ticker = yf.Ticker('AACG') # from the attached major_holders.not.found_0-1.txt
print(ticker.major_holders)
Breakdown                        Value
insidersPercentHeld            0.07085
institutionsPercentHeld        0.16265
institutionsFloatPercentHeld   0.17506
institutionsCount             12.00000
ticker = yf.Ticker('RVSN') # from the attached major_holders.not.found_4-5.txt
print(ticker.major_holders)
Breakdown                        Value
insidersPercentHeld            0.38820
institutionsPercentHeld        0.02128
institutionsFloatPercentHeld   0.03478
institutionsCount             12.00000

using .get() is safer than [key] and allows effective way to return non-None variable
@ValueRaider ValueRaider merged commit 07329db into ranaroussi:dev Aug 7, 2024
1 check passed
@ValueRaider ValueRaider mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants