看板 [ Python ]
討論串[問題] list中插入資料效能的問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 2→)留言2則,0人參與, 最新作者icetofux時間7年前 (2017/02/21 12:31), 7年前編輯資訊
0
0
0
內容預覽:
假設有個list中有上百萬筆資料, 我希望每隔1024筆就插入32筆0xFF, 寫了程式. 如下:. def AppendData(raw_list):. # 製作一個空 list 用來存放資料.. new_list = list(). # 製作一個32筆0xFF的list當作插入用的資料.. in
(還有1688個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者ZolaEmile (Zola)時間7年前 (2017/02/21 17:00), 編輯資訊
0
0
0
內容預覽:
我不確定是不是你要的:. from time import time. old = [str(i) for i in range(10**7)] # set up a list. insert = ['n'] # set up an insert list. def test(old, insert
(還有189個字)
首頁
上一頁
1
下一頁
尾頁