You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Larch to calculate multiple attributes (e.g. convolution, deconvolution ...) of many materials (e.g. CrOH3, Cr_Foil, CrCl3_6H2O, Cr_illite ....) and add them to the Group of each material.
Take CrOH3 as an example, dir(CrOH3) returned ['energy', 'mu', 'flat', 'convolution', 'deconvolution', 'noise'], what can I do if I want to export these attributes to excel in batch?
I have tried locals() in python like:
names = locals()
species = ['CrOH3', 'Cr_Foil', 'CrCl3_6H2O', 'Cr_illite']
attrs = ['energy', 'mu', 'flat', 'convolution', 'deconvolution', 'noise']
df = pd.DataFrame()
for i in species:
for attr in attrs:
df['{}.{}'.format(i, attr)] = names[i].names[attr]
or
for i in species:
for attr in attrs:
df['{}.{}'.format(i, attr)] = names['{}.{}'.format(i, attr)]
but all failed.
Thank you in advance for your help and I am looking forward to your reply~
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I used Larch to calculate multiple attributes (e.g. convolution, deconvolution ...) of many materials (e.g. CrOH3, Cr_Foil, CrCl3_6H2O, Cr_illite ....) and add them to the Group of each material.
Take CrOH3 as an example, dir(CrOH3) returned ['energy', 'mu', 'flat', 'convolution', 'deconvolution', 'noise'], what can I do if I want to export these attributes to excel in batch?
I have tried locals() in python like:
or
but all failed.
Thank you in advance for your help and I am looking forward to your reply~
Beta Was this translation helpful? Give feedback.
All reactions