# You can write small anonymous function with Lambda:
exclamation = (lambda a : a + '!')
exclamation('hello')
echo = (lambda word, e: word*e)
echo('hello',5)
# MAP() WITH LAMBDA FUNCTIONS
# map() applies a function over an object
l = ['a', 'b', 'c', 'd']
exclamation2 = map(lambda a : a+'!', l)
print(list(exclamation2))
# FILTER() WITH LAMBDA FUNCTIONS
# filter() is for filter out elements from a list that don't satisfy certain criteria
l = ['hello', 'hi', 'ciao', 'hola', 'marhabaan', 'hallo', 'alo']
longer = filter(lambda a : len(a) > 4, l)
print(list(longer))
# REDUCE() WITH LAMBDA FUNCTIONS
# reduce() is useful for performing some computation on a list and returns a single value
from functools import reduce
l = ['hello', 'hi', 'ciao', 'hola', 'marhabaan', 'hallo', 'alo']
result = reduce(lambda a, b : a + b, l)
print(result)
Categories
Bash
(3)
BOT
(2)
C#
(1)
Cluster Analysis
(1)
Data Cleaning
(6)
Data Ingestion
(2)
Data Science Specialization
(10)
Data Visualization
(15)
ggplot2
(1)
Hadoop
(1)
Hashnode
(3)
Machine Learning
(5)
MapReduce
(1)
Maps
(1)
Markdown
(7)
Market Basket Analysis
(1)
MATLAB
(1)
Matplotlib
(3)
Numpy
(2)
Octave
(1)
Pandas
(3)
Python
(17)
R
(22)
Regression
(7)
scikit-learn
(1)
Seaborn
(1)
Shell
(3)
Shiny App
(1)
SSIS
(3)
Statistical Inference
(2)
T-SQL
(8)
Unix
(3)
We might permanently block any 카지노 user who abuses these situations. As of June 15, 2022, feedback on DenverPost.com are powered by Viafoura, and you might must log in again to start commenting. If you need assistance or are having points with your commenting account, please email us at
ReplyDelete