Stecke fest bei einem Elemente Vergleich
Verfasst: Mittwoch 25. August 2021, 20:19
Moin, hoffe das mir Jemand helfen und mir meinen Fehler auch erklären kann. Der Code ist folgender:
import numpy as np
import math
data = list()
file = open(input("Was ist der Roboterpfad?"), "r")
for line in file:
line = line.strip("\n")
line_list = line.split("\t")
data.append(line_list)
file.close()
path = np.array(data)
size = np.shape(path)
cols = size[1]
if cols == 7:
print("Hier ist das gewünschte Array:", path)
else:
calc = np.array_split(path, 2)
pi = 2*math.pi
if all(a << pi for a in calc[1]):
print("Hier ist das gewünschte Array:", path)
else:
degrees = np.array(math.degrees(calc[1]))
path = np.append([calc[0]], [[degrees]])
print("Hier ist das gewünschte Array:", path)
und der Fehler kommt in dieser Zeile:
if all(a << pi for a in calc[1]):
Vielen Dank schonmal im Voraus für alle die sich das anschauen
import numpy as np
import math
data = list()
file = open(input("Was ist der Roboterpfad?"), "r")
for line in file:
line = line.strip("\n")
line_list = line.split("\t")
data.append(line_list)
file.close()
path = np.array(data)
size = np.shape(path)
cols = size[1]
if cols == 7:
print("Hier ist das gewünschte Array:", path)
else:
calc = np.array_split(path, 2)
pi = 2*math.pi
if all(a << pi for a in calc[1]):
print("Hier ist das gewünschte Array:", path)
else:
degrees = np.array(math.degrees(calc[1]))
path = np.append([calc[0]], [[degrees]])
print("Hier ist das gewünschte Array:", path)
und der Fehler kommt in dieser Zeile:
if all(a << pi for a in calc[1]):
Vielen Dank schonmal im Voraus für alle die sich das anschauen
