I have code which produces a CSV by printing as shown below
array_all = {'Hand': [alldata], 'Pose':[keypoints], 'Face Pose': [face_position]}
df = pd.DataFrame(
array_all
)
df.to_csv('test.csv',
mode='w',
index=False,
header=True)
To give context to how these objects are created, here's the code for one of the objects, all objects are using the same structure
face_position = []
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')
print(face_position)
Here the face_landmarks refers to objects created from the mediapipe library(https://google.github.io/mediapipe/)
Currently my CSV prints like this
However, I want it to look like this