pvanand commited on
Commit
1a41311
·
verified ·
1 Parent(s): 8f760dd

Update yf_docs.py

Browse files
Files changed (1) hide show
  1. yf_docs.py +9 -12
yf_docs.py CHANGED
@@ -5,21 +5,18 @@ yf_docs = """
5
 
6
  ```python
7
  import yfinance as yf
8
- ticker = yf.Ticker('MSFT')
 
 
9
  ```
10
-
11
- ## Multi-Ticker Usage
12
-
13
- ### Initialization
14
-
15
  ```python
16
- import yfinance as yf
17
- tickers = yf.Tickers('MSFT AAPL GOOG')
18
- ```
19
-
20
- ### Download Historical Data
21
 
22
- Get historical market data for multiple tickers:
23
 
24
  ```python
25
  # Method 1: Using Tickers object
 
5
 
6
  ```python
7
  import yfinance as yf
8
+ ticker = yf.Ticker('MSFT') # Initialize single ticker
9
+ data = ticker.history(period='6mo')
10
+ data.columns, data.shape
11
  ```
12
+ Returns:
 
 
 
 
13
  ```python
14
+ (Index(['Open', 'High', 'Low', 'Close', 'Volume', 'Dividends', 'Stock Splits'], dtype='object'),
15
+ (126, 7))
16
+ ```
17
+ ## Multi-Ticker Usage
 
18
 
19
+ # Get historical market data for multiple tickers:
20
 
21
  ```python
22
  # Method 1: Using Tickers object