« first day (3017 days earlier)      last day (1949 days later) » 

12:46 AM
Is this worthy? stackoverflow.com/q/54159613/4909087 closed as too broad, no roomba
 
1:39 AM
@AnttiHaapala What user script extension are you using? I am using Greasemonkey (4.x) and it works fine there.
 
2:13 AM
hey
do you guys have any site recommendations for learning python
I always get confused with lambda functions
 
yes @moocow
lamba specific or just learning python?
(also yes, I am alive, teaching & working contracts as an analyst which once again move me towards data engineering and with it the best language for data wrangling Python)
 
well
i guess just learning python
but lambda functions are confusing as well
 
2:33 AM
lambas are special really only apply when moving into deeper Python knowledge which is based on a specific path (like data science vs. data engineering vs. web development) - so where are you headed? are you part of a university? are you part of formal education? and have you read our which tutorial should I read?
note to self @JGreenwell that is way too hard to find, students found hard to parse - add to projects folder
fyi, by explaining what you want Python to complete (what are your goals as a software engineer/scientist/whoever else uses Python) - I can direct you to better tutorials and resources. But for University - check your libraries e-books and videos (the University I teach at has probably one of the best video tutorials on Python 3 I have ever seen)
@Jgreenwell - scrape me - also our tutorials do not distinct between 3 and 2 - and no reference to those who left SE (certain roomowner's) NLP tutorials and talks - find/add them
 
If you don't understand lambda calculus : youtube.com/watch?v=eis11j_iGMs
Computerphile comes with a great explanation.
 
well still in hs but im just learning python for fun
 
ah, that I can also work with - what do you want to do in the future?
 
You don't need a mathematical background to understand lambdas in my opinion.
 
hopefully computer science
software
 
2:46 AM
give me a second and I will build up my basic "learn Python" links but what do you want to do? build IOT? web? phone apps? data (my favorite not gonna lie)? desktop?
 
He's just confused about lambda in Python language. :p
 
lol ive only really used Android for phone apps but i like the idea of making apps
 
@IMCoins certainly not - but to understand why would I use them? that is discrete mathematics
 
I was just reading about python when they introduced lambda functions so thats why i became confused i suppose
 
Well, as far as I understand his request, he askes for good python tutorials because he's confused about lambdas. :)
 
2:49 AM
huh? we had lambdas in 1994 (trust me you have an advantage over Java groups which still balk at Maps)
 
To understand lambdas in python, you just need to understand the concept of "boxes" (the 'in' and 'out' of the computerphile video I sent) and the 'namespace' in python in my opinion. :)
 
yeah, but, again, with lambdas when and why is important. As other constructs can be far more powerful and precise - like list or dict comprehensions
 
will do
 
f = lambda x:x+1
f(1) will print 2
f(10) will return 11

A lambda is an **anonymous** function (it doesn't have any name), with an input, and an output. You don't do computations in it.
To the left of the : is the input. To the right, the output.
 
thats all?
 
2:52 AM
so again, why do you feel you need a lambda?
 
i dont haha, i just couldnt understand what they were saying the sites i was learning from
 
685
Q: list comprehension vs. lambda + filter

AgosI happened to find myself having a basic filtering need: I have a list and I have to filter it by an attribute of the items. My code looked like this: my_list = [x for x in my_list if x.attribute == value] But then I thought, wouldn't it be better to write it like this? my_list = filter(lamb...

 
Technically, the x+1 is a computation, but you understand what I meant. :p
If he doesn't understand a lambda function in python, I doubt he will understand the concepts of list comprehensions, and the usage of some functions like filter.
 
lol yep
 
kinda the point, lambda is useful for specific tasks related to functional programming - comprehensions are far more the norm in Python
 
2:57 AM
I think you should level your explanation to the level of your audience ^^
He just wanted to understand how it worked. I don't think he cares about optimization :p
 
i just wanted some links to learn python
lol
 
I'm looking for Martin's or MK's answer (can't remember which) - they have an awesome one somewhere
search is broken on SO so havin' to go through favorites
 
I think this guy is cool :)
You can learn a lot from him
 
960
A: What is a lambda (function)?

mk.Lambda comes from the Lambda Calculus and refers to anonymous functions in programming. Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this. Python def adder(x): ...

 
thanks!
 
3:05 AM
that video has nothing to do with lambdas
not a bad video mind you (actually one of the better ones I've seen .... so bookmarked :)
note, whether to use lambdas or not depends on "can I do this in a simple list comprehension?" i.e. "is there a simple equation I can apply to determine value?", such:
>>> squared = [ x ** 2 for x in range(1,25)]
>>> squared
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, .... 576]
 
those are pretty simple computations so im assuming they get more complex
 
fyi, "simple" equation meaning perform-able in single operation more than "simple"
 
nvm
 
the above? sure. Can always write a list comprehension in a for loop or two - doesn't mean it is the best way - and again I aim at simple here to show where comprehension is better than lambda
 
thanks again
ill read about it
 
3:15 AM
lambda = I need an anonymous function to evaluate specific variables "on the fly" - comprehension = I need to build a data structure from the computations of specific equations
more or less (there is variance, and a bit of it)
fyi, if you really just started Python I would stay towards traditional data structures such as lists, dictionaries, classes, sets, and tuples before moving toward lambdas
 
3:38 AM
Someone, please take a look at this user's question history, starting from the beginning, and tell me they're not messing with the site. Every question is about printing "Ligma" into the terminal.
 
huh? Fortnite players is it
 
thw whole program is one big inside joke — Derek Leyman 1 min ago
 
its all about playing a windows sound based on doing a <insert PC verb for silly thing here> on fortnite
 
I'm wondering if this still makes it on topic or not
 
its on topic
its silly and deserving downvoting but on-topic (at least the first one) <- still looking through others cause this looks familiar and I hate plagiarism
fyi, please see above as agreeing with closure as duplicate (for now) and yes, the whole "ligma", "LIGMA BALLS" is an inside joke I wish I didn't know but I teach teenagers/young adults so...
yep, I have a few programs with print("ligma ballz") lines.....I hope this wasn't one of mine (s/he deleted profile it seems anyway)
 
3:54 AM
Since you're there coldspeed, do you know of any good canonicals for explaining nicely the namespaces in python ?
Okay well I dislike it but someone linked this stackoverflow.com/questions/291978/…
rhubarb for me, its 5am here
 
 
4 hours later…
8:09 AM
@JGreenwell thank you for the anecdata, I appreciate it :)
 
I'm Indian, and I had no clue that word existed, or was even a racial slur
 
The slurness is irrelevant (and obscure)
 
sure, but that wasn't my point. I just haven't heard that word before, which is weird
 
It's not a slur against Indians. And most people haven't heard it.
 
 
1 hour later…
9:46 AM
@poke GM 4.7. It does display the hammer, it just always just displays grey hammer no matter what PHP/Rust question I pick...
 
 
4 hours later…
1:38 PM
@Antti Hmm, grey means that it didn’t load the data yet. Do you get any errors in the browser console? (Ctrl+Shift+J)
 
2:02 PM
any error in the console is actually from
Script error: this method is abstract StackExchange duplicate manager:3091:23
<anonymous>
user-script:Aran-Fey/StackExchange duplicate manager:3091:23
@Aran-Fey ^
didn't remember I had something like that. I disabled it, but the hammer still remains grey @poke
 
 
5 hours later…
7:18 PM
thanks python! Just made my life so much easier. The design for a form I have to fill out like 20 times is really difficult to use. Just captured that form data and submitted it with python. Worked like a charm!
 
7:51 PM
I was trying to integrate paypal with django
with the help of django-paypal what will be the best option 1)I make them do the payment and enter the transaction id and give them the secret key or as soon as payment is done I do something related to session storage ?
 
 
3 hours later…
10:30 PM
someone asking the wrong questions and getting the right answers on world building worldbuilding.stackexchange.com/questions/136671/…
 
11:04 PM
@AndrasDeak actually the first answer is quite incorrect, human can also survive a few minutes in space scientificamerican.com/article/…
 
11:40 PM
ugh
>>> np.diff(np.random.randint(0,2,10).astype(bool))
array([False, False,  True, False, False,  True, False, False, False])

>>> np.diff(np.random.randint(0,2,10))
array([-1,  0,  1,  0, -1,  1,  0,  0,  0])
it's annoying because False - True == -1 and np.bool_ of the same thing will refuse to give an answer
> Notes

Type is preserved for boolean arrays, so the result will contain False when consecutive elements are the same and True when they differ.
it's also a bit weird because it also says
> The type of the output is the same as the type of the difference between any two elements of a. This is the same as the type of a in most cases. A notable exception is datetime64, which results in a timedelta64 output array.
Oh, I misunderstood. I thought it meant the exception with respect to "the same as the type of the difference between any two elements of a".
technically "two elements of a" can't be subtracted so there's no contradiction
thanks, ducky
 

« first day (3017 days earlier)      last day (1949 days later) »