Oh nice, that's better!
@mathspp.com
I'll help you take your Python skills to the next level! Python deep dive every Monday ππ -> https://mathspp.com/insider Short daily drop of Python knowledge ππ§ -> https://mathspp.com/drops
Oh nice, that's better!
At least you managed to make it work! For a while, I couldn't do anything at all :P
Not sure I follow what you mean by βon normally spaced strings less replacing to doβ.
I like " {2,}" because it's easy to miss the double space in the original " +"... I'll replace it, thanks!
I wrote 0 blog posts in February.
Today I already wrote 2.
Go figure. π€·
Came up with 4 random ways to do this.
2, I recommend you use them (although 1 doesn't work!)
The other 2 are really cool β they use fixed points and `itertools.groupby` β but they'll be overkill 99.9% of times.
I meant βThis is, shortEN runs of 2+ [...]β
It was a random thought, indeed.
For a bit more context, see the second approach and how it doesn't work 100%: mathspp.com/blog/remove-...
Nope because if you have newlines, for example, those will disappear!
How do you collapse runs of adjacent spaces in Python?
That is, shorter runs of 2+ consecutive spaces so there's only 1 space there?
I can't come up with a simple/straightforward way to do it with `str.join` and I'm surprised...
What am I missing?
Ok, obrigado!
Pretty impressive! Annoying, but impressive!
And do you have any idea of how much data you spent? In case something similar happens to me π
(My internet has been acting out.)
Pode dar um exemplo de cada sΓ³ para eu nΓ£o ter de rever a sΓ©rie atΓ© perceber? π
Hey all! It's almost time for the next Python Lisbon Meetup! π
On Thursday, pyctrl will be talking about exceptions. We'll cover the origin of exceptions, their usage in OOP, how best to manage them, and more. It's going to be exceptional! π
How did it go? π¬
Thanks for sharing! Neither star nor asterisk are usages that shock me. And yeah, sometimes itβs implied by the context, absolutely.
Ahhhh thatβs what you meant by McGugan boxes! Right :D thanks for the link
Thatβs not what I meant with the question. _What_ are the McGugan boxes?
Then what do you do after I type
βdef f(args)β?
π€£
Interesting... π€
So if you're dictating the signature of the function
def f(*args):
...
You just say βdef F argsβ?
I read it as βstar argsβ.
How do you read `*args` in a function signature?
PLEASE reply with how you'd read it, I'm trying to prove someone wrong π€£
Reposts are appreciated :D
Whatβs the box drawing technique youβre referring to?
π
What do LLMs see?
I wrote a lil' tool that extracts the attention matrices out of open models and creates this typing visual, with each token's opacity changing according to its average attention score as the prompt progresses. Dimmer words are considered less important to the model.
Diagram showing how `itertools.compress` works, taking an iterable with data and an iterable with selectors and making a selection based on the Truthy/Falsy value of the selectors.
`itertools.compress` explained in a simple diagram.
Useful when you need to filter an iterable of data based on a second iterable of flags or selectors.
Diagram explaining how starmap works across a stream of data for a given iterable with pairs (a, b) and a binary function f, producing the iterable with items f(a0, b0), f(a1, b1), etc.
How does this slide look?
Oh, mustβve missed the mastodon Q.
Heh, I had a talk accepted... By accident, since I had withdrawn all my proposals already but I must've done it in between them accepting one of my talks and sending out the emails π€£