Data Analytics with Python for beginner: Pandas (9/18)

Publicado el: 18 noviembre 2022
en el canal de: Edwin Mok
362
3

Notes for Module 9:
https://drive.google.com/file/d/1e5VA...

Files:
https://drive.google.com/file/d/1NVbY...
https://docs.google.com/spreadsheets/...

Solution:
1. Code
import pandas as pd
data = [['Jack',20,12],['Helen',8,11.5],['Catherine',15,14.2],['Rick',-3,13.7]]
info = ['Manager','Returns(%)','Standard Deviation(%)']
fund = ['Fund A','Fund B','Fund C','Fund D']
df = pd.DataFrame(data, index = fund, columns = info)

2. Code
from pandas_datareader import DataReader as pdr
from datetime import datetime as dt
start = dt(2018,1,1)
end = dt(2021,12,31)
fb = pdr("META","stooq",start,end)
amzn = pdr("AMZN","stooq",start,end)
aapl = pdr("AAPL","stooq",start,end)
nflx = pdr("NFLX","stooq",start,end)
goog = pdr("GOOG","stooq",start,end)
fb_return = fn['Close'].pct_change().iloc[1:]
amzn_return = amzn['Close'].pct_change().iloc[1:]
aapl_return = aapl['Close'].pct_change().iloc[1:]
nflx_return = nflx['Close'].pct_change().iloc[1:]
goog_return = goog['Close'].pct_change().iloc[1:]
fb_return.describe()
amzn_return.describe()
aapl_return.describe()
nflx_return.describe()
goog_return.describe()


En esta página del sitio puede ver el video en línea Data Analytics with Python for beginner: Pandas (9/18) de Duración hora minuto segunda en buena calidad , que subió el usuario Edwin Mok 18 noviembre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 362 veces y le gustó 3 a los espectadores. Disfruta viendo!