Augusto Lovelace (@augustolovelace) header
Augusto Lovelace (@augustolovelace) profile picture

15+ years experienced Software Developer. Works with Javascript, ReactJS, VueJS, Python, Php. Here to share, learn and discuss.

Oslo, Norway
Joined December 2022
Hello folks! I have finally decided to create a Twitter account for programming. Let's share, discuss and learn from each other!
64
21
2
601
31,601
#pythontip by Vojtech Filipec: To extract last N characters of DataFrame's column, use df.col.str[-N:] Example:
7
22
145
Something, I have learned teaching Python course last week - there is a method that tries to express given float as a fraction of two integers: >>> a = 0.5 >>> a.as_integer_ratio() (1, 2) >>> (0.75).as_integer_ratio() (3, 4)
10
90
To split an iterable into two iterables based on some test function, use more_itertools.partition. E.g. from more_itertools import partition
1
9
73
Learn how to use Python to generate a QR code with a URL (or any other desired text): import qrcode qr = qrcode.QRCode() qr.add_data('nitter.cf/python_tip') qr.make() qr.make_image(fill_color="black", back_color="white") Colab demo: gist.github.com/simecek/7f9c…
4
28
2
146
23,002
Augusto Lovelace retweeted
Nice little prettier plugin to handle long arrays that get formatted like a giraffe github.com/electrovir/pretti…
20
52
3
763
142,011
Augusto Lovelace retweeted
πŸ”₯ Terminal Tip: Suspend or Background processes to temporarily get access to your prompt. Handy if you need to quickly npm install something, but your server is already running.
10
59
2
437
65,371