Artwork

Sisällön tarjoaa Michael Kennedy and Brian Okken. Michael Kennedy and Brian Okken tai sen podcast-alustan kumppani lataa ja toimittaa kaiken podcast-sisällön, mukaan lukien jaksot, grafiikat ja podcast-kuvaukset. Jos uskot jonkun käyttävän tekijänoikeudella suojattua teostasi ilman lupaasi, voit seurata tässä https://fi.player.fm/legal kuvattua prosessia.
Player FM - Podcast-sovellus
Siirry offline-tilaan Player FM avulla!

#390 Coding in a Castle

36:39
 
Jaa
 

Manage episode 426812349 series 1305988
Sisällön tarjoaa Michael Kennedy and Brian Okken. Michael Kennedy and Brian Okken tai sen podcast-alustan kumppani lataa ja toimittaa kaiken podcast-sisällön, mukaan lukien jaksot, grafiikat ja podcast-kuvaukset. Jos uskot jonkun käyttävän tekijänoikeudella suojattua teostasi ilman lupaasi, voit seurata tässä https://fi.player.fm/legal kuvattua prosessia.
Topics covered in this episode:
Watch on YouTube
About the show

Sponsored by ScoutAPM: pythonbytes.fm/scout

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 10am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Brian #1: Joining Strings in Python: A "Huh" Moment

  • Veronica Berglyd Olsen
  • Standard solution to “read lines from a file, do some filtering, create a multiline string”:

    f = open("input_file.txt") filtered_text = "\n".join(x for x in f if not x.startswith("#")) 
  • This uses a generator, file reading, and passes the generator to join.

  • Another approach is to add brackets and pass that generator to a list comprehension:

    f = open("input_file.txt") filtered_text = "\n".join([x for x in f if not x.startswith("#")]) 
  • At first glance, this seems to just be extra typing, but it’s actually faster by 16% on CPython due to the implementation of .join() doing 2 passes on input if passed a generator.

    • From Trey Hunner: “I do know that it’s not possible to do 2 passes over a generator (since it’d be exhausted after the first pass) so from my understanding, the generator version requires an extra step of storing all the items in a list first.”

Michael #2: 10 hard-to-swallow truths they won't tell you about software engineer job

  1. College will not prepare you for the job
  2. You will rarely get greenfield projects
  3. Nobody gives a BLANK about your clean code
  4. You will sometimes work with incompetent people
  5. Get used to being in meetings for hours
  6. They will ask you for estimates a lot of times
  7. Bugs will be your arch-enemy for life
  8. Uncertainty will be your toxic friend
  9. It will be almost impossible to disconnect from your job
  10. You will profit more from good soft skills than from good technical skills

Brian #3: My thoughts on Python in Excel

  • Felix Zumstein
  • Interesting take on one person’s experience with trying Python in Excel.
  • “We wanted an alternative to VBA, but got an alternative to the Excel formula language”
  • “Python runs in the cloud on Azure Container Instances and not inside Excel.”
  • “DataFrames are great, but so are NumPy arrays and lists.”
  • … lots of other interesting takaways.

Michael #4: Extra, extra, extra

Extras

Brian:

Michael:

Joke: HTML Hacker

  continue reading

403 jaksoa

Artwork

#390 Coding in a Castle

Python Bytes

1,817 subscribers

published

iconJaa
 
Manage episode 426812349 series 1305988
Sisällön tarjoaa Michael Kennedy and Brian Okken. Michael Kennedy and Brian Okken tai sen podcast-alustan kumppani lataa ja toimittaa kaiken podcast-sisällön, mukaan lukien jaksot, grafiikat ja podcast-kuvaukset. Jos uskot jonkun käyttävän tekijänoikeudella suojattua teostasi ilman lupaasi, voit seurata tässä https://fi.player.fm/legal kuvattua prosessia.
Topics covered in this episode:
Watch on YouTube
About the show

Sponsored by ScoutAPM: pythonbytes.fm/scout

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 10am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Brian #1: Joining Strings in Python: A "Huh" Moment

  • Veronica Berglyd Olsen
  • Standard solution to “read lines from a file, do some filtering, create a multiline string”:

    f = open("input_file.txt") filtered_text = "\n".join(x for x in f if not x.startswith("#")) 
  • This uses a generator, file reading, and passes the generator to join.

  • Another approach is to add brackets and pass that generator to a list comprehension:

    f = open("input_file.txt") filtered_text = "\n".join([x for x in f if not x.startswith("#")]) 
  • At first glance, this seems to just be extra typing, but it’s actually faster by 16% on CPython due to the implementation of .join() doing 2 passes on input if passed a generator.

    • From Trey Hunner: “I do know that it’s not possible to do 2 passes over a generator (since it’d be exhausted after the first pass) so from my understanding, the generator version requires an extra step of storing all the items in a list first.”

Michael #2: 10 hard-to-swallow truths they won't tell you about software engineer job

  1. College will not prepare you for the job
  2. You will rarely get greenfield projects
  3. Nobody gives a BLANK about your clean code
  4. You will sometimes work with incompetent people
  5. Get used to being in meetings for hours
  6. They will ask you for estimates a lot of times
  7. Bugs will be your arch-enemy for life
  8. Uncertainty will be your toxic friend
  9. It will be almost impossible to disconnect from your job
  10. You will profit more from good soft skills than from good technical skills

Brian #3: My thoughts on Python in Excel

  • Felix Zumstein
  • Interesting take on one person’s experience with trying Python in Excel.
  • “We wanted an alternative to VBA, but got an alternative to the Excel formula language”
  • “Python runs in the cloud on Azure Container Instances and not inside Excel.”
  • “DataFrames are great, but so are NumPy arrays and lists.”
  • … lots of other interesting takaways.

Michael #4: Extra, extra, extra

Extras

Brian:

Michael:

Joke: HTML Hacker

  continue reading

403 jaksoa

Semua episode

×
 
Loading …

Tervetuloa Player FM:n!

Player FM skannaa verkkoa löytääkseen korkealaatuisia podcasteja, joista voit nauttia juuri nyt. Se on paras podcast-sovellus ja toimii Androidilla, iPhonela, ja verkossa. Rekisteröidy sykronoidaksesi tilaukset laitteiden välillä.

 

Pikakäyttöopas