Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Excel/Excel_Save_file.ipynb
2972 views
Kernel: Python 3

Excel.png

Excel - Save file

Give Feedback | Bug report

Tags: #excel #pandas #save #opendata #yahoofinance #naas_drivers #finance #snippet

Last update: 2023-04-12 (Created: 2022-02-22)

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