Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
namsaraeva committed Jun 5, 2024
1 parent 91fff8b commit cc6b6e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sparcscore/ml/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ def add_hdf_to_index(self, path, target_col):

index_handle = input_hdf.get('single_cell_index')[self.index_list] # get single cell index handle

current_target_col = input_hdf.get('single_cell_index_labelled')[self.index_list].asstr()[:, target_col] # get target column
current_target_col = input_hdf.get('single_cell_index_labelled').asstr()[self.index_list, target_col] # get target column
current_target_col[current_target_col == ''] = np.nan # replace empty values with nan
current_target_col = current_target_col.astype(float) # convert to float for regression

handle_id = len(self.handle_list) # get handle id
self.handle_list.append(input_hdf.get('single_cell_data')[self.index_list]) # append data handle (i.e. extracted images)
self.handle_list.append(input_hdf.get('single_cell_data')) # append data handle (i.e. extracted images)

for current_target, row in zip(current_target_col, index_handle): # iterate over rows in index handle, i.e. over all cells
if self.hours:
Expand Down

0 comments on commit cc6b6e5

Please sign in to comment.