A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.wolfram.com/language/fast-introduction-for-programmers/en/applying-functions/ below:

Applying Functions | Wolfram Language Fast Introduction for Programmers

Applying Functions | Wolfram Language Fast Introduction for Programmers WOLFRAM Products

More mobile apps

Core Technologies of Wolfram Products Deployment Options From the Community Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

WolframConsulting.com

Wolfram Solutions

More Wolfram Solutions

Wolfram Solutions For Education

More Solutions for Education

Learning & Support Get Started More Learning Grow Your Skills Tech Support Company Work with Us Educational Programs for Adults Educational Programs for Youth Read Educational Resources Wolfram Initiatives Events Wolfram|Alpha Wolfram Cloud Your Account Search Navigation Menu The Wolfram Language:
Fast Introduction for Programmers
Show additional notes for:
All sections  Get Started Applying Functions Video Version

It's very common to want to "map" a function over multiple expressions:

In[1]:= Out[1]=

Notes for Python programmers:

Map in the Wolfram Language is like map in Python, except that it can operate on arbitrary expression trees of any depth.

/@ ("slash at") is a short notation for Map:

In[2]:= Out[2]=

Notes for Java programmers:

Map in the Wolfram Language works similarly to the Stream.map method in Java, except that Map can be applied to any kind of expression.

This uses a pure function:

In[3]:= Out[3]=

Apply applies a function to multiple arguments:

In[1]:= Out[1]=

Notes for Python programmers:

Apply in the Wolfram Language is similar to the unpacking operator * in Python.

Expressions have "levels"—corresponding to the number of indices needed to extract a part. Functions like Map can operate at specific levels.

Notes for Java programmers:

"Levels" are another name for dimensions of an array, but generalized for all symbolic expressions. Multi-dimensional operations like this are not built into Java and would normally require loops.

Notes for Python programmers:

"Levels" are like dimensions of an array, but generalized for all symbolic expressions. Python's array functions are typically set up only for one-dimensional arrays.

Map defaults to operate at level 1:

In[1]:= Out[1]=

This operates only at level 2:

In[2]:= Out[2]=

@@ is equivalent to Apply, operating by default at level 0:

In[1]:= Out[1]=

@@@ means "apply at level 1":

In[2]:= Out[2]=

@ means ordinary function application:

In[3]:= Out[3]=

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4