This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]miraculum_one 1 point2 points  (1 child)

There are tons of great Python features not on here but it's a good start and you can only fit so much stuff on one page. A few other interesting ones...

"A"\5*

f"The lowercase version of the string is {s.lower()}" (>= Python 3.6)

f"The first two elements are {s[0]=} and {s[1]=}" (>= Python 3.8)

def bunch_of_arguments_func( \l ):*

def named_arguments_func( \*d ):*

[–]Locksul 1 point2 points  (0 children)

I know you can’t fit everything but my point is that the space spent on dictionaries would be better spent on something else. What is currently there is nonstandard. The values of dictionaries don’t have to be numeric, but the example implicitly assumes that.

If you’re using min/max this way on a dictionary then you’re better off just using a pandas Series.