Python standard library: Splitting and partitioning

preview_player
Показать описание


Subscribe to this channel, as I try to go through all of the Python standard library!
Рекомендации по теме
Комментарии
Автор

This is incredibly helpful. Thank you!

nicholasrodriguez
Автор

str.rpartition() seems like a great way of extracting the file "prefix" and file extension from a filename, especially when you consider that you can have dots anywhere in a filename (e.g. "1.2_lecture_notes.txt"). This is something I probably would have resorted to regex for, so thanks for the great video!

(I've realised that if you have a *.tar.gz file, the output of str.rpartition(".") may not be what you expect, though it would technically be correct: ("filename.tar", ".", "gz"))

TiredOcean
Автор

split letters in a word without spaces to a new column?

AkachiIsLove