On python, is there any way to chain functional commands? Eg in js: result= list.filter(bla).map(bla)?
-
-
Replying to @AndyTWoods
If I understand your question (exhausted right now), it's the same in Python as your example, no?
1 reply 0 retweets 1 like -
Replying to @o_guest
Gosh I always thought you had to do this in python filter(map(bla, f), f). I've never used functional stuff in python. Super useful in js I find tho :)
4 replies 0 retweets 1 like -
Replying to @AndyTWoods @o_guest
I always thought it was annoying python doesn't have map, filter etc as object methods like js. Someone else points out spark etc that have it. Outside of distributed compute land, haven't seen it as much other than as sugar. Also, can't find any pep that discusses it.
3 replies 1 retweet 5 likes -
I find it extremely annoying that python doesn't have them as object methods, while many libraries do. e.g. map(lambda x : blah, mylist) vs df.apply(lambda x: blah)
1 reply 1 retweet 3 likes -
Replying to @EmilyGorcenski @bcmcmahan and
Add to that the list comprehension syntax and it becomes damn near untenable to write thematically-consistent code
1 reply 0 retweets 2 likes -
Andy Woods Retweeted Andy Woods
I came up with this. Those pesky back-slashes I dont like :Shttps://twitter.com/AndyTWoods/status/948553338743869440 …
Andy Woods added,
1 reply 1 retweet 3 likes -
I like this in the sense that it feels much more akin to Ruby's or C#'s style. I struggle with my moral adherence to the law of demeter
1 reply 0 retweets 3 likes -
you don't need the backslashes if you use parentheses. check out the last example plot on this page: http://seaborn.pydata.org/generated/seaborn.FacetGrid.html#seaborn.FacetGrid …
2 replies 0 retweets 2 likes
I'm in team weirdo that likes the backslashes
-
-
:O i actively try to avoid backslashes hehe. i think it's b/c the slashes color weird in subl. also since python handles () automagically, it enables several multiline things: variable unpacking in the assignment, imports, & chaining dot methods (if they return `self`).
0 replies 0 retweets 3 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.