Skip to content

Commit

Permalink
fix height percentile error in generate_main_manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
cfrick13 committed Oct 3, 2024
1 parent 7756434 commit 6112a6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nuc_morph_analysis/lib/preprocessing/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ def get_dataframe_by_info(info):
# Load dataframe by file format
if path.endswith("csv"):
df = pd.read_csv(path)

# use height calculated from 1st to 99th percentile values
# rather than the most extreme values
df["height"] = df["height_percentile"]
if "height_percentile" in df.columns: # only some datasets have this column
df["height"] = df["height_percentile"]
return df
elif path.endswith("parquet"):
df = pd.read_parquet(path)

# use height calculated from 1st to 99th percentile values
# rather than the most extreme values
df["height"] = df["height_percentile"]
if "height_percentile" in df.columns: # only some datasets have this column
df["height"] = df["height_percentile"]
return df
else:
raise ValueError(f"Unknown format {path.split('.')[-1]}")
Expand Down

0 comments on commit 6112a6f

Please sign in to comment.