AttributeError: 'MPDataDoc' object has no attribute 'average_imaginary_dielectric'

Hi… I am facing this error, the code which i am using is

with MPRester("MY_API_KEY") as mpr:
    docs = mpr.materials.summary.search(
        material_ids=['mp-16934'],
        fields=["average_imaginary_dielectric"]
    )
    average_imaginary_dielectric = docs[0].average_imaginary_dielectric

Could anyone please help with this issue.
Thanks

Please post the full traceback / error message. Thanks!

PS: It looks like you might need to use mpr.materials.absorption.search() to access that field.

Thanks @tschaume, it worked.

However, I am trying to fetch A2BB’O6 data with their absorption data. However, I am unable to do it.

from mp_api.client import MPRester

with MPRester(“MY_API_KEY”) as mpr:
docs = mpr.materials.absorption.search(

    fields=["material_id", "absorption_coefficient", "composition_reduced", "formula_pretty"]
)
mpids = [(doc.material_id, doc.absorption_coefficient, doc.composition_reduced, doc.formula_pretty ) for doc in docs]
print(mpids.head())

Hi @AnjaliKumari this material does not have absorption data. check the detail page here.