吳崧晹python讀取CSV檔案SPDR標普500ETF在1993/1/29至2025/3/20

#吳崧晹python程式碼分析spy:標準500ETF import csv #輸入套件csv=comma seperated value #輸入csv套件comma separated value file = open('SPY.CSV','r') #打開下載的檔案SPY.CSV,模式是r讀取, csvreader = csv.DictReader(file) #將檔案讀入變數csvreader for row in csvreader: #檔案接續逐列附加append於rows串列 # print(row) print(row['日']+' 當天收盤價 '+row['收']) file.close() #關閉檔案 #上一個作業讀近來放成串列list,直接讀成字典

留言

  1. https://d11117328.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html
    https://d11117328.blogspot.com/2025/06/blog-post.html
    https://d11117328.blogspot.com/2025/05/listdictsetexcel.html
    https://d11117328.blogspot.com/2025/05/powerpoint1mp41mp4.html
    https://d11117328.blogspot.com/2025/05/2025power-d11117328.html
    https://d11117328.blogspot.com/2025/03/pythonspy.html
    https://d11117328.blogspot.com/2025/03/pythoncsvspdr500etf19931292025320.html
    https://d11117328.blogspot.com/2025/03/202537-d11117328.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

程式碼註解

馬可維茲風險平均數平面