Closed sandyisabeau closed 3 years ago
Excellent question! "NA"
can't be added to the blacklist as, in some cases, it refers e.g. to North America. We can actually discuss the string "N/A"
to be seen as incomplete data (but I tend not to).
Apart from that, you are indeed right: The current library doesn't have any function to delete data entries by a given key-value pair. I see three different approaches that could be implemented:
deleteByValue(data, prop, value)
intersectData()
so that the user can choose either to keep the intersection or the not-intersecting data. Like this, you could use findAllByValue()
and pass it to intersectData()
.deleteIncompleteData()
a third, optional parameter emptyVals
which can be a single value or an array of values which are additionally considered as empty.I think the third option would be the smoothest, what do you think?
With the new update you should now be able to use medalData = gmynd.deleteIncompleteData(medalData, "Medal", "NA")
. Is that what you were looking for?
Yes, that's what I was looking for:) I was able to sort and delete the missing medals already, but I'll try it out with the new update. Thank you:)
Would it be possible to add "NA" as a missing property? I wanted to filter the medals, but had some issues since NA isn't included. Thank you!