Easier way to do this?

Fabien fabien.maussion at gmail.com
Thu Oct 5 05:46:46 EDT 2017


On 10/05/2017 12:00 AM, Thomas Jollans wrote:
> On 04/10/17 22:47, Fabien wrote:
>> On 10/04/2017 10:11 PM, Thomas Jollans wrote:
>>> Be warned, pandas is part of the scientific python stack, which is
>>> immensely powerful and popular, but it does have a distinctive style
>>> that may appear cryptic if you're used to the way the rest of the world
>>> writes Python.
>> Can you elaborate on this one? As a scientist, I am curious;-)
> Sure.
> 
> Python is GREAT at iterating. Generators are everywhere. Everyone loves
> for loops. List comprehensions and generator expressions are star
> features. filter and map are builtins. reduce used be a builtin, even
> though almost nobody really understood what it did.
> 
> In [1]: import numpy as np
> 
> In the world of numpy (and the greater scientific stack), you don't
> iterate. You don't write for loops.

Right, now I see what you meant. The first thing I teach to my students 
is that loops are evil, and that they should always avoid them when 
possible ;-)

Cheers,

Fabien



More information about the Python-list mailing list