To create a matrix in pandas, we can use the DataFrame()
method. We can pass the data to be stored in the matrix as a list of lists or a numpy array.
Here's an example code snippet:
main.py384 chars14 lines
The output will be:
main.py145 chars12 lines
gistlibby LogSnag