I imported a Dataframe
using pandas
then wrote some code (as below) to create an additional column. I need to extract a subset of the newly added column and then create an if statement that will allow me to look at the last 2 values of the integers and apply the following logic:
- If the integer ends in 9 perform a +2 addition (for example: 9+2=11)
- For anything else perform a +1 addition (for example 4+1=5)
This is the code I've written so far to create the additional column:
max_items['ind_short'] = ((max_items['Item'] % 1000).astype(int))
Can anyone help?