List replace nulls with first item above in list



Is it possible to replace all nulls with the first value above:
ie 40 to 46 should be Utilities


If you need an ootb solution you can do something like this:

But Python is really your best bet for a quick and easy solution.


I would do it like this:


Using DesignScript:

For Loop in DS - Distances between multiple Points

thanks very much!! I am gonna try that this afternoon.



with the help above I made this python script, this one runs on a 2d array

OUT = []
collumn = 0
numberofcollumns = 10
list = IN[0]

while collumn < numberofcollumns:
	for i in range(len(list)):
		if list[i][collumn] is None:
			list[i][collumn] = list[i-1][collumn]
	collumn = collumn + 1
OUT = list

I definitely want to learn more about python