PL/Python seems like the obvious choice. Here's a little quick tutorial to get you started. This is useful for situations where you need the database to automatically perform some operation (e.g. trigger), or from a stored procedure and your language of choice is python.
However, if it's just a one-off operation to go over all data and update something, it's probably better to write this outside the database in a script and just run it against the database. Generally speaking, maintaining your code outside the database itself is better. You can more easily version-control it, run tests against it and update it as necessary. That of course depends on many factors so it's more a question of preference than something definitive. PL/Python wouldn't exist if it didn't have a legitimate use-case (and obviously it does).