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
If you do a manual REDCap export, you have the choice of "labels" or "raw", which affects the column headings, e.g. a choice between "More than one race (choice='White')" and "race_multi___1", for a column for a dropdown-type field whose name is "race_multi" and whose label is "More than one race".
The PyCap documentation claims:
# Same data, but keys will the field labels
data = project.export_records(raw_or_label='label')
However, in the code, it suggests that this option actually controls the values, not the keys, and I saw no difference in the field keys.
Also, the code made it sound like the event_name option might control the use of field labels as keys, but I didn't see that it affected the returned results at all. (My data is in a "classic" repository database project, BTW).
I was hoping to reproduce the effects of a manual export with labels, but it seems that will take a little work (to apply labels, order the fields, etc).
The text was updated successfully, but these errors were encountered:
The ordering is difficult to ensure. Also, all the [form_name]_complete columns will not be renamed. Form status fields are unfortunately not in the data dictionary. You might use project.forms to add renaming keys to the field_to_label dict.
Note, the above requires the pandas library. You could just as easily double-loop through the records and keys, but pandas makes so many things so easy.
If you do a manual REDCap export, you have the choice of "labels" or "raw", which affects the column headings, e.g. a choice between "More than one race (choice='White')" and "race_multi___1", for a column for a dropdown-type field whose name is "race_multi" and whose label is "More than one race".
The PyCap documentation claims:
However, in the code, it suggests that this option actually controls the values, not the keys, and I saw no difference in the field keys.
Also, the code made it sound like the
event_name
option might control the use of field labels as keys, but I didn't see that it affected the returned results at all. (My data is in a "classic" repository database project, BTW).I was hoping to reproduce the effects of a manual export with labels, but it seems that will take a little work (to apply labels, order the fields, etc).
The text was updated successfully, but these errors were encountered: