diff --git a/allensdk/brain_observatory/ecephys/stimulus_analysis/receptive_field_mapping.py b/allensdk/brain_observatory/ecephys/stimulus_analysis/receptive_field_mapping.py index 74e75cabd..57ab351d6 100644 --- a/allensdk/brain_observatory/ecephys/stimulus_analysis/receptive_field_mapping.py +++ b/allensdk/brain_observatory/ecephys/stimulus_analysis/receptive_field_mapping.py @@ -284,8 +284,12 @@ def _response_by_stimulus_position( dataset[spike_count_key] = dataset.sum(dim=time_key) dataset = dataset.drop(time_key) - dataset[row_key] = presentations.loc[:, row_key] - dataset[column_key] = presentations.loc[:, column_key] + dataset = dataset.assign_coords( + {row_key: ("stimulus_presentation_id", + presentations.loc[:, row_key].to_numpy())}) + dataset = dataset.assign_coords( + {column_key: ("stimulus_presentation_id", + presentations.loc[:, column_key].to_numpy())}) dataset = dataset.to_dataframe() dataset = (