Mathematica: Functional Operations

Favorite Article   

  • Function (&) — specify a pure function (e.g. (#+1)&)
  • #, ##, #name — slots for variables in a pure function
     

Applying Functions to Lists

  • Map (/@) — map across a list: f/@{x,y,z}?{f[x],f[y],f[z]}
  • Apply (@@, @@@) — apply to a list: f@@{x,y,z}?f[x,y,z]
  • MapIndexed — map with index information: {f[x,{1}],f[y,{2}],f[z,{3}]}
  • MapThread    
  • MapAt   
  • MapAll    
  • Scan  
     

Iteratively Applying Functions

  • Nest, NestList, NestGraph — nest a function: f[f[f[x]]] etc.
  • Fold, FoldList — fold in a list of values: f[f[f[x,1],2],3] etc.
  • SequenceFold    
  • SequenceFoldList   
  • FoldPair    
  • FoldPairList
  • FixedPoint, FixedPointList — repeatedly nest until a fixed point
  • NestWhile    
  • NestWhileList  
  • TakeWhile   
  • LengthWhile  
     

List-Oriented Functions

  • Select — select from a list according to a function
  • Array — create an array from a function
  • SortBy    
  • MaximalBy    
  • SplitBy  
  • GatherBy  
     

Association-Oriented Functions

  • AssociationMap — create an association from a function
  • KeySortBy    
  • CountsBy    
  • GroupBy  
     

Functional Composition

  • Identity  
  • Composition   
  • Operate    
  • Through   
  • Distribute 
     

"Curried" Operator Forms

  • Select  
  • Cases    
  • Append  
  • Map   
  • Position 

 

Referenced from: Reference.wolfram.com

 

19590
1/11/2018 8:54:19 AM