Insert keyframe for only one rotation axis?

If I set an object’s rotation like this:

obj.rotation_euler[0] = angle


And then keyframe it like this:

bpy.data.objects[obj.name].keyframe_insert(data_path='rotation_euler', frame = f)

It sets keyframes on the ‘y’ and ‘z’ axes also.

How do I only insert a keyframe on one rotation axis?

Thanks

Okay, I must be getting tired.

Simply include an index value like this:

bpy.data.objects[obj.name].keyframe_insert(data_path='rotation_euler', index = 0, frame = f)

0 for x
1 for y
2 for z

Solved!