Format number to string
Tags: #pandas #dataframe #format #snippet #yahoofinance #naas_drivers #operations #jupyternotebooks
Description: This notebook provides an example of how to convert numerical values to strings using the Pandas library.
from naas_drivers import yahoofinance
ticker = "TSLA"
date_from = -100
date_to = "today"
df_yahoo = yahoofinance.get(ticker, date_from=-5)
df_yahoo
df_yahoo["VALUE"] = df_yahoo["Close"].map("€ {:,.2f}".format).str.replace(",", " ")
df_yahoo
Last modified 1mo ago