title: Converting matrix-like string into matrix
body: <p>I want to convert a string from a .txt file into an actual matrix that i can use in my code. The .txt file looks like this:</p>
  
  <pre><code>Version:1
  
  Matrix1
  [ 0.83568616  2.15352694 -4.4027591  -1.74058247 -0.42605484 -0.21766954]
  [-1.0363443  -1.07584464  0.67931046  1.82348912  1.71141435 -0.40177167]
  [-0.49192281  0.83897739 -0.97685038  1.3442258   1.91058796 -0.46493662]
  [ 0.42825634 -0.58257726  2.0370751  -1.11937523 -3.81475336  2.66557629]
  </code></pre>
  
  <p>I have tried this different ways, but here's what I currently have:</p>
  
  <pre><code>f = open("C:/Users/Username/Desktop/Output_data/output_data1.txt", "r")
  string1 = [x.strip() for x in f.readlines()]
  string1 = string1[3:7]
  Matrix1 = np.array(string1)
  for elem in Matrix1:
      elem = float(elem)
  </code></pre>
  
  <p>This doesn't work because an (elem) of Matrix1 is a string(including the brackets).</p>
  
  <p>Is there an easy way to convert this into a Matrix I can use?</p>