ufunc 'subtract' did not contain a loop with signature matching types
<pre><code>import scipy as sy
import numpy as np
import re

from numpy import *

P = np.array(input('Please enter the P vector:\n'))
Q = np.array(input('\nPlease enter the Q vector:\n'))
R = np.array(input('\nPlease enter the R vector:\n'))


print('\n\nP: ',P)
print('Q: ',Q)
print('R: ',R)

#calculations for question 1
PQ=Q-P
magPQ= sy.sqrt(dot(PQ,PQ))
#calculations for question 2
PR= R-P
#calculations for question 3
QP = P-Q
QR = R-Q
magQP=sy.sqrt(dot(QP,QP))
magQR=sy.sqrt(dot(QR,QR))
angle=sy.arccos(dot(QP,QR)/(magQP*magQR))
angled=angle*180/sy.pi
#calculations for question 4
Area = sy.sqrt(dot(cross(PQ,QR),cross(PQ,QR)))
#calculations for question 5
magPR =sy.sqrt(dot(PR,PR))
perimeter = magPQ+magQR+magPR

######################OUTPUT#######################

print("Question 1. What is the distance between P and Q?")
print("Answer: ",round(q1,4))

print("\nQuestion 2. What is the distance vector from P to R?")
print('Answer: ',q2)

print("\nQuestion 3. What is the angle between QP and QR?")
print('Answer: ',angled)

print("\nQuestion 4. What is the area of the triangle PQR?")
print('Answer: ',Area)

print("\nQuestion 5. What is the perimeter of triangle PQR?")
print('Answer: ',perimeter)
</code></pre>

<p>Above is my code, when I try to compile, I get the error</p>

<pre><code>Traceback (most recent call last):
File "Homework1-3.py", line 17, in &lt;module&gt;
PQ=Q-P
TypeError: ufunc 'subtract' did not contain a loop with signature matching types dtype('&lt;U6') dtype('&lt;U6') dtype('&lt;U6')
</code></pre>

<p>It's pretty important I am able to input my arrays because I would like this program to be able to solve problems. It seems like its using string instead of float. How could I fix this?</p>