Here is a small sampling of my dataset:
Search_Term Exit_Page Unique_Searches Exit_Pages_actual
nitrile gloves /store/catalog/product.jsp? 10 /store/catalog/product.jsp?
zytek gloves /store/product/KT781010 20 /store/pro
So this should be pretty easy, not sure why I am not getting it to work. I am trying to pull into the Exit_Pages_actual column when the all the characters in the Exit_Page when the first 10 characters are "/store/pro" or "/store/cat". When that is not the case, I want it to pull in only the first 10 characters from Exit_Page. As you can see above, my code works fine for the catalog but not for the product (aka works for the first condition in my OR but not the 2nd per the code below). What is wrong? So there is no error message, it just does not gives me the right result for product, only outputs the first 10 characters rather then the whole string:
Exit_Pages['Exit_Pages_actual'] = np.where(Exit_Pages['Exit_Page'].str[:10]==('/store/cat' or '/store/pro'),Exit_Pages['Exit_Page'].str[:],Exit_Pages['Exit_Page'].str[:10])
Exit_Pages