I'm preparing a dataset right now and I need it to have a certain format, such as this:
Hand | Pose |
---|---|
No | Seating Back |
Yes | Seating Back |
No | Seating Back |
Yes | Seating Back |
No | Seating Back |
Yes | Seating Back |
However, currently it's producing
0 | |
---|---|
Hand | ['No', 'No', 'No', 'No', 'No', 'No', 'No'] |
Pose | ['Seating Back', 'Seating Back', 'Seating Back'] |
As you can see the values inside the array stored in one cell while I need it to be un-nested in a where one value occupies one cell.
My code:
array_all = {'Hand': alldata, 'Pose': keypoints}
df = pd.Series(array_all)
# Keypoint detection
df.to_csv('test.csv',
mode='w',
header=True,
index=True)
df.transpose()
To give context to the object, here is a snippet on one of them
for data_point in results.face_landmarks.landmark:
if 0.6 <= data_point.x < 0.8:
face_position.append('Straight')
else:
face_position.append('Angled')
All arrays are being appended in this manner.