Question: I am trying to normalize row values in a dataframe. The values that need to be normalized contain the text, 'Count' in their column header. There are other columns that do not have the word 'Count' in their header and I would like them to remain unchanged. I have a normalization value that is in a column named, 'Normalization value.' 

Therefore, in row wise iteration, each row's normalization value needs to be multiplied by every value that belongs to a column whose header contains the word 'count.' This dataframe has a multiindex that I would like to preserve and is many columns and rows long so I need to do this without specifying exact locations or names.

To no avail I've tried variations of multiply, broadcasting, itertuples, user defined functions.

This is my example dataframe:

```
Sample Timepoint CountA CountB PercentA PercentB CountC Normalization Value
1           1       10     20     40       30       50        .1
2           1       20     10     25       35       100       .2
2           2       50     20     20       22       40        .5

```

This is what I would like the dataframe to look like after normalizing counts:

```
Sample Timepoint CountA CountB PercentA PercentB CountC Normalization Value
1           1       1     2     40       30       5        .1
2           1       4     2     25       35       20       .2
2           2       25    10    20       22       20       .5

```

Answer: 
You can using `str.contains` , then assign the `mul` result back with `.loc` , also here since you need assign it back ,with `filter` will failed 

```
s=df.columns.str.contains('Count')
df.loc[:,s]=df.loc[:,s].mul(df['Normalization Value'],0)
df
Out[238]: 
   Sample  Timepoint         ...          CountC Normalization Value
0       1          1         ...             5.0                 0.1
1       2          1         ...            20.0                 0.2
2       2          2         ...            20.0                 0.5
[3 rows x 8 columns]

```
You need to filter the columns using [`.filter()`](http://[https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.filter.html]) with `regex` and then modify them and put it back to the main dataframe using `.loc`.

```
df.loc[:, df.filter(regex='Count*', axis=1).columns] = df.loc[:, df.filter(regex='Count*', axis=1).columns].multiply(df['Normalization'], axis='index')

```

Output:

```
      Sample  Timepoint  CountA  CountB  PercentA  PercentB  CountC  Normalization
0       1          1     1.0     2.0        40        30     5.0            0.1
1       2          1     4.0     2.0        25        35    20.0            0.2
2       2          2    25.0    10.0        20        22    20.0            0.5

```