I'm quite new to python, and happen to have used C# for some time now. I saw that there was a filter method to use with the collections, which seems to be the equivalent of the LINQ's where clause.
I wondered, is there also an equivalent for the LINQ's select statement in python?
Example: my_collection.select(my_object => my_object.my_property)
would return a collection of the my_property of each object in my_collection.
Python is an interpreted, high-level, general-purpose programming language. C is a general-purpose, procedural computer programming language. Interpreted programs execute slower as compared to compiled programs. Compiled programs execute faster as compared to interpreted programs.
CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the Python language. CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecode before interpreting it.
Python code can make calls directly into C modules. Those C modules can be either generic C libraries or libraries built specifically to work with Python. Cython generates the second kind of module: C libraries that talk to Python's internals, and that can be bundled with existing Python code.
c command Specify the command to execute (see next section). This terminates the option list (following options are passed as arguments to the command). - anything afterward is passed as options to python script or command, not interpreted as an option to interpreter itself.
[my_object.my_property for my_object in my_collection]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With