I have the following line
open.loc[(open['Genesis'] == 'Incomplete Name') & (open['Date'] >= last_date),'Result'] = 'Missing information'
- 'last_date' is a variable equal to a specific date week (2022-25)
- 'open' is my dataframe
- 'Result' is a column of my dataframe, as well as 'Date' and 'Genesis'
What I'm trying to do is to transform that line of code into something where instead of specifying the value of 'Incomplete' in the ['Genesis'], I could have something like the 'LIKE' operator in SQL, to get more information, since the ['Genesis'] column has values like:
- 'Incomplete Name'
- 'Incomplete color'
- 'Incomplete material'
And to replace the ['Result'] value with the ['Genesis'] value itself, since I do not want to manually specify every possible outcome of that column.
I've tried something like the following but I'm struggling to make it work:
`for word in open['Genesis']: if word.startswith('Incomplete') and open['Date'] >= last_date: open['Result'] = open['Genesis']`
Thanks in advance!