Points.matching

Points.matching(function, *, useLog=None)

Identifying points matching the given criteria.

Return a boolean value object by applying a function returning a boolean value for each point in this object. Common any/all matching functions can be found in nimble’s match module. Note that the featureName in the returned object will be set to the __name__ attribute of function unless it is a lambda function.

Parameters:

function (function) –

  • function - in the form of function(pointView) which returns True, False, 0 or 1.

  • query - string in the format ‘POINTNAME OPERATOR VALUE’ (i.e “pt1 < 10”, “id4 == yes”, or “row4 is nonZero”) where OPERATOR is separated from the POINTNAME and VALUE by whitespace characters. See nimble.match.QueryString for string requirements.

Returns:

nimble Base object – A feature vector of boolean values.

See also

count, nimble.match

Examples

>>> from nimble import match
>>> lst = [[1, -1, 1], [-3, 3, 3], [5, 5, 5]]
>>> X = nimble.data(lst)
>>> allPositivePts = X.points.matching(match.allPositive)
>>> allPositivePts
<Matrix 3pt x 1ft
     allPositive
   ┌────────────
 0 │    False
 1 │    False
 2 │     True
>
>>> from nimble import match
>>> lst = [[1, -1, float('nan')], [-3, 3, 3], [5, 5, 5]]
>>> X = nimble.data(lst)
>>> ptHasMissing = X.points.matching(match.anyMissing)
>>> ptHasMissing
<Matrix 3pt x 1ft
     anyMissing
   ┌───────────
 0 │    True
 1 │   False
 2 │   False
>

Keywords: boolean, equivalent, identical, same, matches, equals, compare, comparison, same, filter