Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

create a 2d array in python

def build_matrix(rows, cols):
    matrix = []

    for r in range(0, rows):
        matrix.append([0 for c in range(0, cols)])

    return matrix

if __name__ == '__main__':
    build_matrix(6, 10)
Comment

PREVIOUS NEXT
Code Example
Python :: context manager requests python 
Python :: python generator for reading and writing file 
Python :: how to add sum of range in python 
Python :: remove item from list python grepper 
Python :: pyspark pivot max aggregation 
Python :: python warshall algorithm stackoverflow 
Python :: qaction hide show python 
Python :: select features and label from df 
Python :: how to convert 2 dimensional in 1 dimensional array 
Python :: os.startfile on raspberry 
Python :: Random Remarks Example in python 
Python :: xpath h4 contains text 
Python :: python convert py to exe 
Python :: python code to open an application 
Python :: recursionerror maximum recursion depth exceeded in comparison 
Python :: how to randomise a string in python 
Python :: syntax error in python 
Python :: remove outlier using IQR 
Python :: python bytes to hex 
Python :: how to make one list from nested list 
Python :: bokeh bar chart 
Python :: flask socketio send 
Python :: float and int difference 
Python :: pd.explode 
Python :: is_integer python 
Python :: how to add items in list in python 
Python :: last element python 
Python :: Fun & learn with python turtle 
Python :: python instagram bot 
Python :: python else syntax 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =