- print - print a text string or the value of a variable
- lower - return a string in all lower case
- len - get the length of a string
- split - turn a string into a list, broken (by default) on white spaces
- join - turn a list into a string
- type - get the data type of the selected object (usually the value of a variable)
- find out how many sentences are in the novel Moby Dick (or any other text)
- turn a plain text passage into a list of comma separated values (.csv) so it can be opened in Excel
- randomly switch words in a passage around, making "word salad"
There were high-fives and cheers before lunch as code snippets executed without errors. And after lunch, there was a triumphant show-and-tell in which our merry band became real programmers by showing off their code and hearing from other programmers how they would have done it differently. :)
We also did some work in the afternoon building a topic model using gensim. Using libraries, moving into an IDE (from iPython notebooks) and working out i/o workflow were the real objectives in that introduction, but we did get to see and discuss the results of an LDA topic model. Real DH stuff after just two days!
No comments:
Post a Comment