Spaces:
Runtime error
Runtime error
Update yf_docs.py
Browse files- 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 |
-
|
| 17 |
-
|
| 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
|