Remove a dictionary from a list of dictionaries
📁 lambda, List, dictionary, Advanced Python Topics
I have a list of dictionaries. It contains a person's name, where they are coming from and where they are going. But one dictionary does not have a "from" value. How do I remove this dictionary from the list?
tour = [ { "name": "Alexander", "from": "Moscow", "to": "Kazan" }, { "name": "Alice", "from": "Moscow", "to": "Kazan" }, { "name": "Sergey", "to": "Kazan" }] I solved this by downloading and installing the unofficial pyaudio package with .whl extension:
- Downloaded the package with .whl extension from the link. You need to select the pyaudio version that matches your python version. For example, if you have python3.7.x (x64 version) installed, select the package PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl, where cp37 indicates python version 3.7.x, and amd64 indicates the corresponding architecture.
After downloading, I installed the package using pip (navigate to the folder with the package and install it, specifying the full package name with its extension):
cd <folder with pyaudio.whl package>pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl
As a result, I got
Log in to leave an answer