Term frequency charts warning message #2197
DavidFrenchSG
started this conversation in
General
Replies: 1 comment 2 replies
-
I played around with this a bit more and realised that the proposed solution above would check for partial matches. I think this works instead: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I noticed that when creating a term frequency chart, a "not found in the dataset" warning message appears even when the names provided are in the dataset. Indeed, such a warning message appears in the output on the help page here, despite "Robert" and "Grace" appearing on the chart.
I am very new to Python, so apologies if I have misunderstood something, but I think the problem is in line 240 of term_frequency.py:
vals_not_included = [val for val in vals_to_include if val not in df["value"]]
For reasons I don't really understand, this seems to return every value in vals_to_include, regardless of whether they are in df["value"]
I think this line of code works instead:
vals_not_included = [val for val in vals_to_include if ~df["value"].str.contains(val).any()]
Did that make sense? Have I completely misunderstood something?
Dave
Beta Was this translation helpful? Give feedback.
All reactions