Skip to content

Commit

Permalink
fix issue with pandas series string equals
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuelia committed Nov 28, 2023
1 parent 162da40 commit 225ba19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pandora/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ def run_mds(
embedding = pd.DataFrame(
data=embedding, columns=[f"D{i}" for i in range(n_components)]
)
embedding["population"] = populations
embedding["population"] = populations.values

# since we are using EIGENSOFT to compute the FST distance matrix, we remove all sample IDs with poopulation
# set to ``Ignore`` as they are not present in the distance matrix
Expand Down Expand Up @@ -1152,8 +1152,8 @@ def run_pca(
embedding = pd.DataFrame(
data=embedding, columns=[f"D{i}" for i in range(n_components)]
)
embedding["sample_id"] = self.sample_ids
embedding["population"] = self.populations
embedding["sample_id"] = self.sample_ids.values
embedding["population"] = self.populations.values
self.pca = PCA(embedding, n_components, pca.explained_variance_ratio_)

def run_mds(
Expand Down Expand Up @@ -1231,7 +1231,7 @@ def run_mds(
embedding = pd.DataFrame(
data=embedding, columns=[f"D{i}" for i in range(n_components)]
)
embedding["population"] = populations
embedding["population"] = populations.values

self.mds = from_sklearn_mds(
embedding, self.sample_ids, self.populations, mds.stress_
Expand Down

0 comments on commit 225ba19

Please sign in to comment.