Save file
Tags: #excel #pandas #save #opendata #yahoofinance #naas_drivers
Author: Florent Ravenel

Input

Import libraries

1
import pandas as pd
2
from naas_drivers import yahoofinance
Copied!

Variables

1
# Input yahoo
2
ticker = "TSLA"
3
date_from = -100
4
date_to = 'today'
5
interval = '1d'
6
moving_averages = [20, 50]
7
8
# Output
9
excel_file_path = f"{ticker}.xlsx"
Copied!

Model

Read excel

1
df_yahoo = yahoofinance.get(ticker,
2
date_from=date_from,
3
date_to=date_to,
4
interval=interval,
5
moving_averages=moving_averages)
Copied!

Output

Display result

You want to add more parameters ? 👉 Check out the pandas documentation here.
1
df_yahoo.to_excel(excel_file_path)
2
print(f'💾 Excel '{excel_file_path}' successfully saved in Naas.')
Copied!
Last modified 2mo ago
Copy link
Edit on GitHub