Structures from Matminer to .xyz file

Hi everyone. I’m new here.

I’m currently trying to convert the structure column obtained from matminer to .xyz file, and I don’t know if there’s a function available. df["structure] looks like below.

And I want to write a file containing texts as follows:


atom1 x1 y1 z1
atom2 x2 y2 z2
atom3 x3 y3 z3
and so on

Is there a way to do that?
Your help would be greatly appreciated.