为什么numpy.append函数在附加数组中给我小数

时间:2019-05-11 03:34:53

标签: python python-3.6

我有一个填充的数组A和一个空白的数组B,然后继续执行for循环,这样我就可以将A的值转换为B,只是看它是否有效并且正确完成了,我只是想知道为什么我在B中的每个条目之后都有这些无意义的小数点,该小数点后没有任何内容。抱歉,一开始没有代码,所以当我运行这段代码时,我与使用numpy.append将distanceXHG的值传输到HomeXGShot的位置稍有不同,无论出于何种原因,它之后都会添加一个小数。现在在末尾添加一个2nd 13值

   HomeXG = [0.21,0.66,0.1,0.14,0.01,0.51,0.35]
   AwayXG = [0.04,0.06,0.01,0.04,0.06,0.12,0.13]
   #Angle of the shots from the center of goal. Center of goal through 
   midfield and to other goal is 0 degrees.
   AngleHXG = [17,12,31,17,1,5,55]
   AngleAXG = [14,20,1,9,15,20,49]
   AngleHXG =[d*((math.pi)/180) for d in AngleHXG]
   AngleAXG =[d*((math.pi)/180) for d in AngleAXG]
   #Distance in yards from the center of the goal line, biggest factor in xG
   distanceHXG = [15,18,9,4,11,5,13]
   distanceAXG = [12,17,28,9,3,20,19]
   print(AngleHXG)
   HomeXGShot=[]

   for i in distanceHXG:
     print (i)
     HomeXGShot= numpy.append(distanceHXG,i)



   print(HomeXGShot)

我认为这是行得通的,但是它给了我最后13次两次。

0 个答案:

没有答案