Skip to content

Commit

Permalink
Fix column name clash bug
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbradley committed Jan 31, 2024
1 parent 5157291 commit 37f38e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion andromeda-ui/components/DataExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function DataExplorer(props: DataExplorerProps) {
if (weights) {
let highlightValues: {[key:string]: number} = {}
if (highlightImageKey) {
highlightValues = images.find((x) => x.label == highlightImageKey);
highlightValues = images.find((x) => x.label == highlightImageKey).values;
}

weightControls = Object.keys(weights).map(key => <WeightSlider
Expand Down
7 changes: 5 additions & 2 deletions andromeda/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ def dimensional_reduction(self, weights):
)
self.add_label_and_url_columns(image_coordinate_df)
min_max_dataframe = self.get_min_max_scaled_dataframe()
final_coordinate_df = image_coordinate_df.merge(min_max_dataframe, on='Image_Label')
return weight_series.to_dict(), final_coordinate_df.to_dict("records")
coordinate_dict_ary = image_coordinate_df.to_dict("records")
for item in coordinate_dict_ary:
series = min_max_dataframe.loc[item['label']]
item['values'] = series.to_dict()
return weight_series.to_dict(), coordinate_dict_ary

@staticmethod
def create_weight_series(weights, columns):
Expand Down

0 comments on commit 37f38e8

Please sign in to comment.