Jul-28-2020, 01:20 PM
(This post was last modified: Jul-28-2020, 01:20 PM by Kristenl2784.)
Hello,
This is just a portion of the code, I thought I would only cut out what I'm currently working on. This part of the code is inside a for loop that loops through a lot of excel files.
I'm having a problem with line 5, for some reason it only shows False throughout the whole dataframe. I don't have the string names because there's to many of them so I had to create string2 on line 4. This grabs the string out of ws1. Am I not able to use \bstring2\b? I basically want the total number of True statements that show for each string found.
This is just a portion of the code, I thought I would only cut out what I'm currently working on. This part of the code is inside a for loop that loops through a lot of excel files.
I'm having a problem with line 5, for some reason it only shows False throughout the whole dataframe. I don't have the string names because there's to many of them so I had to create string2 on line 4. This grabs the string out of ws1. Am I not able to use \bstring2\b? I basically want the total number of True statements that show for each string found.
stops2 = pd.read_excel(Hold,usecols = "B,D", skiprows=3,header=None,index=False) stops2.columns=['Hold','Name'] stops3=stops2[stops2.Hold != 'Pace'].sort_values(by=['Name']) string2=ws1['A1'].value[28:] counts4=stops3['Name'].str.match(r'\bstring2\b').sum() z3=counts4