Map: Implementing map reduce with lambda functions (python)
The map function makes a transformation of each element of an array to a correspondent element in a new list that will be produced as output. The transformation of each element is handled by a function that is parametrized in the map function call. In this example below the function to perform the transformation is defined using the lambda syntax. names = [ "Peter Parker" , "Tony Stark" , "Natasha Romanova" ] # Using lambda function namesFormatted = list ( map ( lambda el: el.upper() , names)) The output of the map function is a Map object, then to handle its data as a normal list, it is possible to convert the Map object to an standard list using the list function, as presented in the example. The complete code is available to be downloaded here: https://github.com/rafaelqg/code/blob/main/map_lambda.py You may see a video class about this video here: