Relative Content

Tag Archive for pythonexcelpandasregex

Pandas and replacing Excel values incosistently

I’m using the syntax below to replace only specific values in the ‘content_text’ column based on the macro_id column in my spreadsheet but the results are very inconsistent. Essentially the macros are numbers that represent text and they are all uniform as far as character count and delimiters, however, and I cannot figure out why some macro ids never get replaced. There are instances where there are multiple macro_ids in the context field but sometimes they aren’t replaced when there is only one. There are only about 4200 rows and I’m really hoping my laptop isn’t just tapping out.