im trying to check if a row in my csv file has a usage that says "Training", "PublicTest", or "PrivateTest" (Each row is classified as one of these three, except even though usage is the word "Training", the program recognizes it as not the same word, anything I can do to fix this?
training_data = []
test_data = []
train_images = []
train_labels = []
test_images = []
test_labels = []
def format_data(path):
for row in open(path):
idx = 0
with open(path) as d:
emotion, image, usage = d.readlines()[idx + 1].split(",")
if usage is "Training":
train_labels.append(int(emotion))
imageArr = []
imageArr.append(image)
train_images.append(imageArr)
print(train_images)
elif usage is "PublicTest" or usage is "PrivateTest":
test_labels.append(int(emotion))
imageArr = []
imageArr.append(image)
test_images.append(imageArr)
print(test_images)
idx += 1
print("This row has been iterated over!")
# print(row)
# add any more formatting
# train_images/255.0
# test_images/255.0
def load_data():
return train_images, train_labels, test_images, test_labels
format_data(path)```