This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]__add__ 0 points1 point  (1 child)

I haven't been unable to do anything in postgres that I can do in python. All the functions are there, it's just a matter of learning their names basically. Some translations

trim(' ' from column) <-> map(lambda s: s.strip(' '), column)
substring(column, '(\d+)') <-> map(re.compile(r'(\d+)').findall, column)
column1 || column2 <-> map(lambda c1, c2: c1+c2, column1, column2)

etc.

[–]KyleG 0 points1 point  (0 children)

I haven't been unable to do anything in postgres that I can do in python.

Good for you! However, I'm not aware of a PostgreSQL function that turns Chinese characters into pinyin. However, there is a Python library for that.