Template request | Bug report | Generate Data Product
Tags: #excel #pandas #save #opendata #yahoofinance #naas_drivers #finance #snippet
Author: Florent Ravenel
Description: This notebook allows users to save their Excel files quickly and easily.
import pandas as pd
from naas_drivers import yahoofinance
# Input yahoo
ticker = "TSLA"
date_from = -100
date_to = "today"
interval = "1d"
moving_averages = [20, 50]
# Output
excel_file_path = f"{ticker}.xlsx"
df_yahoo = yahoofinance.get(
ticker,
date_from=date_from,
date_to=date_to,
interval=interval,
moving_averages=moving_averages,
)
You want to add more parameters ?
👉 Check out the pandas documentation here.
df_yahoo.to_excel(excel_file_path)
print(f'💾 Excel '{excel_file_path}' successfully saved in Naas.')