Delete multiple elements in python list

Isn't there a good function? How to use: dellist (list, index you want to delete)

python


dellist = lambda items, indexes: [item for index, item in enumerate(items) if index not in indexes]
A=["a","b","c","d","e","f","g","h"]
r=[0,4,5]

dellist(A,r)
>>['b', 'c', 'd', 'g', 'h']

Recommended Posts

Delete multiple elements in python list
Getting list elements in Python
Extract multiple list duplicates in Python
[Python] Manipulation of elements in list (array) [Add / Delete]
Sorted list in Python
Filter List in Python
List find in Python
How to delete multiple specified positions (indexes) in a Python list
Randomly select elements from list (array) in python
Sort list elements in a specified order in Python
[Python] Manipulating elements in a list (array) [Sort]
How to remove duplicate elements in Python3 list
Multiple regression expressions in Python
Specify multiple list indexes (Python)
Avoid multiple loops in Python
Prohibit multiple launches in python
[Python] Outputs all combinations of elements in the list
Group by consecutive elements of a list in Python
Make sure all the elements in the list are the same in Python
[Python] Show multiple windows in Tkinter
python web scraping-get elements in bulk
Difference between list () and [] in Python
Output 2017 Premium Friday list in Python
Sort and output the elements in the list as elements and multiples in Python.
Get Python list elements with multiple indexes (number) Simple method
Statistical test (multiple test) in Python: scikit_posthocs
[Python] list
Handle multiple python versions in one jupyter
When specifying multiple keys in python sort
Display a list of alphabets in Python 3
OR the List in Python (zip function)
Difference between append and + = in Python list
Process multiple lists with for in Python
Summary of built-in methods in Python list
Get the EDINET code list in Python
[Python] Understand list slicing operations in seconds
[Python] Combine all the elements in the array
Quadtree in Python --2
Python in optimization
CURL in python
Combine multiple dictionaries and add multiple elements at once, safely and non-destructively in Python
Metaprogramming in Python
Python 3.3 in Anaconda
Python basics: list
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
N-Gram in Python
Programming in python
Plink in Python
[Introduction to Python] How to delete rows that meet multiple conditions in Pandas.DataFrame
Extract every n elements from an array (list) in Python and Ruby
Constant in python
Lifegame in Python.
FizzBuzz in Python