Skip to content

Commit

Permalink
fix for nans in table["color"].str.match(color_triplet_re)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoDF authored Sep 18, 2024
1 parent a9b5c68 commit 8f48a83
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_stimulus_presentations(self):
# coded as rgb triplets and the other as -1 or 1
if "color_triplet" not in table.columns:
table["color_triplet"] = pd.Series("", index=table.index)
rgb_color_match = table["color"].str.match(color_triplet_re)
rgb_color_match = table["color"].str.match(color_triplet_re).astype(bool)
table.loc[rgb_color_match, "color_triplet"] = table.loc[
rgb_color_match, "color"]
table.loc[rgb_color_match, "color"] = ""
Expand Down

0 comments on commit 8f48a83

Please sign in to comment.