list_len = len(old_list) list = [None] * list_len not list = [None] * len(old_list) Use Case: When I create DataFrames, I’ll create a series of lists to fill. The DataFrame is created by using lists. reviews is a list of HTML blocks. Here’s how I would have normally set up the lists. texts = [None] …
Continue reading “Speeding Up Creating Multiple Empty Lists in Python”