劉任昌期末考

import csv #德明科大劉任昌修改11與16列
f = open('00960.csv','r',encoding='utf-8')
csv_reader = csv.reader(f)
header, rows = [], []        #宣告空白串列(陣列,清單)
header = next(csv_reader)     #串列header存放第一列標題
for row in csv_reader:        #逐列讀檔案、附加append於rows串列
   rows.append(row)
f.close()
idSet = set()
component = dict()
#zeros = [0 for i in range(21)] 
for row in rows:
    for j in range(0, 21):
        idSet.add(row[j*4])
for id in idSet:
    component[id] = [0 for i in range(21)] #取代原來的zeros
for row in rows:
    for j in range(0, 21):
        if row[j*4+3] != '':
            component[row[j*4]][j] = row[j*4 + 3]
            print(row[j*4+1],component[row[j*4]])
for id in idSet:
    print(id, component[id])

原來

修改後

留言

  1. https://hsiao-yu0711.blogspot.com/2026/06/blog-post_25.html

    回覆刪除
  2. https://fanyahui.blogspot.com/2026/06/blog-post_25.html

    回覆刪除
  3. https://s10655075.blogspot.com/2026/06/blog-post.html

    回覆刪除
  4. https://stanley-ouo.blogspot.com/2026/06/blog-post.html

    回覆刪除
  5. https://lukelu0928.blogspot.com/2026/06/blog-post.html

    回覆刪除
  6. https://yiminglinn.blogspot.com/2026/06/blog-post.html

    回覆刪除
    回覆
    1. 很有效率ttps://yiminglinn.blogspot.com/2026/06/blog-post.html
      522野村https://yiminglinn.blogspot.com/2026/05/00960.html

      刪除
    2. 很有效率ttps://yiminglinn.blogspot.com/2026/06/blog-post.html
      522野村https://yiminglinn.blogspot.com/2026/05/00960.html
      這個亂搞被導致不能留言這個亂拷貝導致不能留言https://yiminglinn.blogspot.com/2026/04/blog-post_23.html

      刪除
  7. https://11217133d.blogspot.com/2026/06/blog-post.html?m=1

    回覆刪除
    回覆
    1. 你是民族的救星,你是世界的偉人。

      刪除
  8. https://xuan0729.blogspot.com/2026/06/blog-post.html

    回覆刪除
  9. https://the-most-great.blogspot.com/2026/06/blog-post.html

    回覆刪除
  10. https://the-most-great-tony11.blogspot.com/2026/06/blog-post.html

    回覆刪除
  11. https://laiweikaiaaa.blogspot.com/2026/06/blog-post.html

    回覆刪除
  12. https://hank20050328.blogspot.com/2026/06/blog-post.html

    回覆刪除
  13. https://yunn-xin.blogspot.com/2026/06/blog-post.html

    回覆刪除
  14. https://chenyouhong.blogspot.com/2026/06/blog-post.html

    回覆刪除
  15. https://tsaiziytang.blogspot.com/2026/07/blog-post.html

    回覆刪除
  16. https://liucaiwu.blogspot.com/2026/07/import-csv-1116-f-open00960.htm

    回覆刪除
  17. https://giinasmile.blogspot.com/2026/07/blog-post.html

    回覆刪除
  18. https://draft.blogger.com/blog/post/edit/preview/1413291454110337811/5418144711097195372

    回覆刪除
  19. https://michelle814.blogspot.com/2026/07/blog-post.html

    回覆刪除
  20. https://chen0119.blogspot.com/2026/07/blog-post.html

    回覆刪除
  21. https://shenzhenxuan.blogspot.com/2026/07/blog-post.html

    回覆刪除
  22. https://kungyuting.blogspot.com/2026/07/blog-post.html

    回覆刪除
  23. https://honghikun.blogspot.com/2026/07/blog-post.html

    回覆刪除
  24. https://li1007.blogspot.com/2026/07/blog-post.html

    回覆刪除
  25. https://d11217119.blogspot.com/2026/07/blog-post.html

    回覆刪除
  26. https://su-you-an.blogspot.com/2026/07/import-csv-1116-f-open00960.html

    回覆刪除
  27. https://www.blogger.com/blog/post/edit/preview/7981990836789718013/4218357398466207263

    回覆刪除
  28. https://liu-guang-wei.blogspot.com/2026/07/import-csv-1116-f-open00960.html

    回覆刪除
  29. https://the-most-little-black.blogspot.com/2026/07/blog-post.html

    回覆刪除
  30. https://xi-xbox-mmi.blogspot.com/2026/07/import-csv-1116-f-open00960.html

    回覆刪除
  31. https://56788888.blogspot.com/2026/07/blog-post.html

    回覆刪除
  32. 作者已經移除這則留言。

    回覆刪除
  33. https://linxinzhuo.blogspot.com/2026/07/blog-post.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌美國星期一假日法案,蒙地卡羅證券價格模擬

劉任昌蒙地卡羅模擬,遊戲驛站軋空事件