Naas Documentation
Naas.ai
GitHub
Slack Community
What's new?
Search…
Welcome to Naas
😎
Templates
AWS
Airtable
AlphaVantage
Bazimo
Boursorama
Bubble
CCXT
CSV
Canny
Celestrak
Cityfalcon
D-Tale
Dask
Data.gouv.fr
Draft Kings
EM-DAT
Elasticsearch
Excel
FAO
FEC
FTP
GitHub
Gmail
Google Analytics
Google Drive
Google Search
Google Sheets
HTML
Healthchecks
HubSpot
Hugging Face
IFTTT
IMDB
INPI
IUCN
Insee
Instagram
Integromat
Johns Hopkins
Jupyter
Jupyter Notebooks
LinkedIn
Matplotlib
Metrics Store
Microsoft Teams
Microsoft Word
MongoDB
MySQL
NASA
Naas
Naas Auth
Neo
Newsapi
Notion
OpenWeatherMap
OwnCloud
PDF
Pandas
Merge Dataframes
ISO Date Conversion
Transform dataframe to dict
Format number to string
Create dataframe from dict
Convert datetime series
Create Pivot Table
Pillow
Pipedrive
Plaid
Plotly
PostgresSQL
PyPI
Python
Qonto
Quandl
Reddit
Redshift
Remoteok
Remotive
SAP-HANA
SendGrid
Slack
Snowflake
Societe.com
Spotify
Streamlit
Stripe
Telegram
Thinkific
TikTok
Trello
Twilio
Twitter
WSR
WorldBank
Worldometer
XML
YahooFinance
YouTube
Youtube
ZIP
Zapier
spaCy
Google Analytics
Google Drive
Google Search
Google Sheets
Hugging Face
Johns Hopkins
Jupyter Notebooks
Metrics Store
Microsoft Teams
Microsoft Word
Naas Auth
Elastic Search
Excel 365
🔄
Low-code features
🏎
Low-code drivers
🌎
Community
Essentials
Advanced
Best Practices
FAQ
⚡
Naas manager
🔐
Security
Powered By
GitBook
Transform dataframe to dict
Tags:
#pandas #dict #snippet #yahoofinance #naas_drivers
Author:
Florent Ravenel
With this template, you can convert dataframe to dictionary in pandas WITHOUT index
Input
Import libraries
1
from
naas_drivers
import
yahoofinance
Copied!
Input parameters
👉 Here you can change the ticker, timeframe and add moving averages analysis
1
ticker
=
"TSLA"
2
date_from
=
-
100
3
date_to
=
'today'
Copied!
Model
Get dataframe from Yahoo Finance
1
df_yahoo
=
yahoofinance
.
get
(
ticker
,
2
date_from
=-
5
)
3
df_yahoo
Copied!
Output
Transform dataframe
Params = orient
list: keys are column names, values are lists of column data
records: each row becomes a dictionary where key is column name and value is the data in the cell
1
dict_yahoo
=
df_yahoo
.
to_dict
(
orient
=
"records"
)
2
dict_yahoo
Copied!
Previous
ISO Date Conversion
Next
Format number to string
Last modified
2mo ago
Copy link
Edit on GitHub
Contents
Input
Model
Output