Closed zillurbmb51 closed 1 year ago
Hello,
Did you specify working with Cohort when you tried to retrieve fields? Please see a code snippet below.
_cohort = dxdata.loadcohort(folder="/", name="cohort") #select your cohort name or use - id="record-xxx" - instead
_df = participant.retrieve_fields(names=field_names, filtersql=cohort.sql, engine=dxdata.connect()) df.show(5, truncate=False)
Hi,
Another possible cause of this failure could be that one of the other fields (in the field_ids) is probably not in scope for the application (or you have made some other typo in the number), and likely fields_for_id(f) returns an empty array for that field, hence [0] is out of range.
I hope this helps. If you have any questions or you need any assistance in then future, please send them to support@dnanexus.com and our Support Team will assist you.
Hi, I have created two cohorts using cohort browser namely "exome_natd_case" and " exome_natd_control" for the above mentioned data field. I can load them using dxdata.load_cohort
But when I try to retrieve field description I am getting the following attached error:
list out of range ![list_out_of_index_dxdata](https://user-images.githubusercontent.com/12833907/154571422-1fbe0b3f-3b03-48e2-99eb-4d15cfcb4baf.png)
Any help on this matter?