About 83,200 results
Open links in new tab
  1. python - How to define a two-dimensional array? - Stack Overflow

    Jul 12, 2011 · Long back when I was not comfortable with Python, I saw the single line answers for writing 2D matrix and told myself I am not going to use 2-D matrix in Python again. (Those …

  2. matrix - How to make matrices in Python? - Stack Overflow

    Sep 30, 2013 · If you wanted to show the rows and columns transposed, transpose the matrix by using the zip() function; if you pass each row as a separate argument to the function, zip() …

  3. Python: convert matrix to positive semi-definite - Stack Overflow

    Apr 6, 2017 · from numpy import linalg as la import numpy as np def nearestPD(A): """Find the nearest positive-definite matrix to input A Python/Numpy port of John D'Errico's `nearestSPD` …

  4. python - How to make a matrix of arrays in numpy? - Stack Overflow

    Mar 20, 2013 · which is still a matrix of arrays of the same size. Is there such a multiplication function? And also, if I multiply T with a normal scalar matrix t = [[a,b],[c,d]] where a,b,c,d are …

  5. python - Create a matrix out of an array - Stack Overflow

    Nov 9, 2015 · The array has a length of 25, and what I'm trying to do is construct a 5x5 matrix out of it. I have used both numpy.asmatrix() and the matrix constructor but both result in a matrix …

  6. python - How do I create 3x3 matrices? - Stack Overflow

    Jan 29, 2015 · How to create a matrix? (Python) 0. Making a Matrix in Python. 0. Creating an array matrix in python. 1.

  7. python - Simple way to create matrix of random numbers - Stack …

    Apr 30, 2015 · I am trying to create a matrix of random numbers, but my solution is too long and looks ugly random_matrix = [[random.random() for e in range(2)] for e in range(3)] this looks …

  8. python - Plot correlation matrix using pandas - Stack Overflow

    Mar 27, 2019 · Because sometimes the colors do not clear for you, heatmap library can plot a correlation matrix that displays square sizes for each correlation measurement. import …

  9. python - Converting two lists into a matrix - Stack Overflow

    So how do I transform the second scenario into the first. I've tried np.insert to add the second array to a test matrix I had in a python shell, my problem was to transpose the first array into a …

  10. Python: How do I create 2x2 array with NumPy? - Stack Overflow

    The best way to start with numpy is to make an array like: ... a matrix, or convert a 2D array into matrix ...