Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

IS_ELEMENT_OF

IS_ELEMENT_OF, IS_ELEMENT_OF_STR,  IS_ELEMENT_OF_STR_N

 

IS_ELEMENT_OF(A, B) returns 1 if any element of numeric argument B matches any element of numeric argument A, and 0 if there is no match

IS_ELEMENT_OF_STR(A,B) works on string arguments A and B

IS_ELEMENT_OF_STR_N(A,B) works on string arguments A and B, and does case insensitive matching. It returns1 if 1st arg contains any of the values in 2nd arg, 2 if there is a case-insensitve match, else 0.

Arguments:

A

variable to search

 

B

variable to match

Result Axes:

X

Abstract, 1 element long

 

Y

Normal

 

Z

Normal

 

T

Normal

Example:

yes? list/nohead IS_ELEMENT_OF ({44,55,66}, {55}) 1.00

 

IS_ELEMENT_OF_STR is case sensitive

yes? list/nohead IS_ELEMENT_OF_STR ({"HELLO", "hello", "Friend"}, {"Friend", "bye"}) 
1.00 
 
yes? list/nohead IS_ELEMENT_OF_STR ({"HELLO", "hello", "Friend"}, {"friend", "heLLo"}) 
0.00

IS_ELEMENT_OF_STR_N(VAR,VALUES) returns 2 if there is a case-insensitive match.

yes?  list/nohead IS_ELEMENT_OF_STR_N ({"friend"}, {"HELLO", "hello", "Friend"})
2.000
yes?  list/nohead IS_ELEMENT_OF_STR_N ({"Friend"}, {"HELLO", "hello", "Friend"})
1.000