Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
R0bL authored Apr 16, 2024
1 parent 176b2ff commit 7a1f2bb
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,32 +154,6 @@ The data being evaluated are SEC filings of 1260 Equities held by the Norwegain
Cross refrenced data pulled with y_finance [yfinance](https://pypi.org/project/yfinance/) - Norwegain Wealth Fund Database did not have the correct industry tags:

```
import pandas as pd
import yfinance as yf
from tqdm import tqdm
# Assuming 'test' is your dataframe and it already exists
# Make sure it is either the full dataframe or a copy, to avoid SettingWithCopyWarning:
# test = df.head().copy()
# Enable tqdm for pandas apply
tqdm.pandas()
# Function to fetch sector for a ticker
def fetch_sector(ticker):
try:
ticker_data = yf.Ticker(ticker)
return ticker_data.info.get('sector', "N/A")
except Exception as e:
return "Error"
# Apply the function to your dataframe to create a new 'Sector' column
# Using progress_apply instead of apply to show the progress bar
df['Sector'] = df['Ticker'].progress_apply(fetch_sector)
# Display the updated dataframe
df.head()
```
# Step 2: Use sec-api.io to pull 10-K by ticker:
Expand Down

0 comments on commit 7a1f2bb

Please sign in to comment.