Category Archives: Python

Python: Working with text files, an example using PubMed references

My colleagues and I recently needed to identify all the PubMed references on a given topic and locate email addresses of the corresponding authors. The good news is that the Author information section of PubMed references contains one or more email addresses approximately half of the time. This meant that I could automate the extraction of these email addresses by

Read more

Python: Data structures

Python has a number of in-built data structures. Two of the most common structures are lists and dictionaries. In Python, a list is a sequence of values and is constructed with square brackets, e.g. [1, 5, ‘abc’, 34.8]. The values in a list can be numbers or strings. A dictionary is a sequence of keys associated with values and is

Read more
« Older Entries Recent Entries »