Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Allow a function to perform pure numeric computation by silently ignoring non-numeric values
ResourceFunction["NFunction"][fun] makes a special operator form of fun that performs pure numeric computation by ignoring non-numeric values. |
Mean processed by NFunction will ignore non-numerical values when applied to a list:
In[1]:= | ![]() |
Out[1]= | ![]() |
For arrays with rank ≥ 2, NFunction is applied columnwise:
In[2]:= | ![]() |
Out[2]= | ![]() |
Custom functions can be processed by NFunction:
In[3]:= | ![]() |
Out[3]= | ![]() |
Functions processed by NFunction can work with Dataset:
In[4]:= | ![]() |
Out[4]= | ![]() |
Functions processed by NFunction can work with Quantity:
In[5]:= | ![]() |
Out[5]= | ![]() |
Functions processed by NFunction can work with Around:
In[6]:= | ![]() |
Out[6]= | ![]() |
Functions that produce results similar to List can also be processed by NFunction:
In[7]:= | ![]() |
Out[7]= | ![]() |
Non-numeric results are given as Indeterminate:
In[8]:= | ![]() |
Out[8]= | ![]() |
Functions processed by NFunction give the same results as those without processing when applied to numeric data arrays:
In[9]:= | ![]() |
Out[10]= | ![]() |
Some functions require a minimum number of valid values:
In[11]:= | ![]() |
Out[11]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License