Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.88 KB

Excel_Save_file.md

File metadata and controls

60 lines (40 loc) · 1.88 KB



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.

Input

Import libraries

import pandas as pd
from naas_drivers import yahoofinance

Variables

# Input yahoo
ticker = "TSLA"
date_from = -100
date_to = "today"
interval = "1d"
moving_averages = [20, 50]

# Output
excel_file_path = f"{ticker}.xlsx"

Model

Read excel

df_yahoo = yahoofinance.get(
    ticker,
    date_from=date_from,
    date_to=date_to,
    interval=interval,
    moving_averages=moving_averages,
)

Output

Display result

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.')