Closed CarlinLiao closed 1 month ago
When create_bimodal_vector uses this return block, it returns a normal python list instead of a pandas series, since that's what BimodalityAssessor does.
create_bimodal_vector
https://github.com/nadeemlab/SPT/blob/a8985a41a75534f522faf48afdbb5a61bf1f6d7a/data_curation/convenience_scripts/bimodality_assessor.py#L162-L163
A quick fix to
if quality >= 0.5: res = pd.Series(assessor.get_dichotomized_feature(use_threshold=True, original=s), index=s.index) res.name = s.name return res
will preserve the ordering/index/metadata of the input series s, as if you ran apply on it like is done if this if block isn't triggered.
s
apply
When
create_bimodal_vector
uses this return block, it returns a normal python list instead of a pandas series, since that's what BimodalityAssessor does.https://github.com/nadeemlab/SPT/blob/a8985a41a75534f522faf48afdbb5a61bf1f6d7a/data_curation/convenience_scripts/bimodality_assessor.py#L162-L163
A quick fix to
will preserve the ordering/index/metadata of the input series
s
, as if you ranapply
on it like is done if this if block isn't triggered.