[PYTHON] When you want to use it as it is when using it with lambda memo

Easy to write because python does not need to close the door

When you want to use it as it is when using it with lambda

Write normally

>>> text = "Which is Kinoko SaMpLE ?"
>>> text.lower().replace("sample", "takenoko")
'which-kinoko-takenoko-?'

Write using lambda

>>> text = "Which is Kinoko SaMpLE ?"
>>> (lambda x: x.lower().replace("sample", "takenoko"))(text)
'which-kinoko-takenoko-?'

I don't know if there is a scene that I actually want to use as it is

The ternary operator if ~ else can now be used on python, but in that case processing cannot be inserted [x if x < 100 else 'kinoko' for x in A] Can bring value

Recommended Posts

When you want to use it as it is when using it with lambda memo
[OpenCV] When you want to check if it is read properly with imread
Solution when you want to use cv_bridge with python3 (virtualenv)
[AWS] What to do when you want to pip with Lambda
Use aggdraw when you want to draw beautifully with pillow
When it is troublesome to copy what you built with vue
When you want to send an object with requests using flask
I know? Data analysis using Python or things you want to use when you want with numpy
It is better to use Weight Initializer when initializing with HeNormal with Chainer
Gist repository to use when you want to try a little with ansible
It is convenient to use Layers when putting a library on Lambda
Personal best practice template to use when you want to make MVP with Flask
Settings when you want to run python-mecab with travis
When you want to filter with Django REST framework
It is convenient to use stac_info and exc_info when you want to display traceback in log output by logging.
When the variable you want to superscript with matplotlib is two or more characters
What to do if you don't want to use Japanese column names when using ortoolpy.logistics_network
When you want to register Django's initial data with relationships
When you want to use python2.x on modern Gentoo Linux
If you want to use field names with hyphens when updating firestore data in python
Don't write Python if you want to speed it up with Python
When you want to keep the Sphinx documentation theme as usual
When you want to print to standard output with print while testing with pytest
[Python] When you want to use all variables in another file
[TensorFlow] If you want to run TensorBoard, install it with pip
It is convenient to use Icecream instead of print when debugging.
When you want to adjust the axis scale interval with APLpy
When you want to use multiple versions of the same Python library (virtual environment using venv)
I want to improve efficiency with Python even in an experimental system (4) Use ser.close () when an error is thrown using try syntax
Is it deprecated to use pip directly?
[Python] Complete preprocessing Memo as it is
ImportError when trying to use gcloud package with AWS Lambda Python version
I want to get angry with my mom when my memory is tight
I want to do it with Python lambda Django, but I will stop
When you want to replace a column with a missing value (NaN) column by column
Memorandum of means when you want to make machine learning with 50 images
Read CSV file with Python and convert it to DataFrame as it is
AssertNumQueries is useful if you want to easily test N + 1 queries with django
How to build an environment when you want to use python2.7 after installing Anaconda3
I want to use MATLAB feval with python
If you don't know how to draw the graph you want with matplotlib, it is convenient to look at the gallery.
I tried to use Java with Termux using Termux Arch but it didn't work
When you want to update the chrome driver.
How to deal with SessionNotCreatedException when using Selenium
I want to use Temporary Directory with Python2
I don't want to use -inf with np.log
I want to use ip vrf with SONiC
If you want to enter the virtual environment with jupyter, nb_conda_kernels is recommended
If you want to make a discord bot with python, let's use a framework
When writing a test using DB with django, you may be able to do it faster by using `setUpTestData ()`
What are you using when testing with Python?
A convenient function memo to use when you want to enter the debugger if an error occurs when running a Python script.
[Python] I want to use only index when looping a list with a for statement
It is better to use NTFS when connecting SSD to Linux to create a file server.
Use AWS Lambda + LINE Notify to notify LINE not to forget your umbrella when you get home
Memo of how to use properly when combining pandas.DataFrame
If you want to use Cython, also include python-dev
Links to do what you want with Sublime Text
When you want to play a game via Proxy
I want to AWS Lambda with Python on Mac!
Specify MinGW as the compiler to use with Python