Applied filter breaks groupby aggregation
#### Code Sample, a copy-pastable example if possible

***EDIT: See comments below for copy-paste example***

I don't have a full copy-paste example but my data frame has the format
value (float) | test_name (str) | test_number (int)

```python
def filter_outlier_robust_simga(grp):
    q1 = grp.value.quantile(.25)
    q3 = grp.value.quantile(.75)
    iqr = q3 - q1
    # f = 1.724  # robust 3 sigma f value
    # f = 2.836  # robust 4.5 sigma f value
    f = 3.948  # robust 6 sigma f value

    lol = q1 - f*iqr  # lower outlier limit
    uol = q3 + f*iqr  # upper outlier limit

    grp['lol'] = lol
    grp['uol'] = uol

    fil = (grp.value < uol) & (grp.value > lol)

    return grp[fil]

def filter_non_electrical_tests(df):
    filt = ~df['test_name'].isin([
        "HW Bin",
        "SW Bin",
        "Pass",
        "SiteID",
        "TestTime",
        "TotalTime",
        "IndexTime"])
    
    return df[filt]

(pd.read_csv('{}_test_data.csv'.format("TGC2668-SM"))
 .pipe(filter_non_electrical_tests)  
 .groupby('test_name').apply(filter_outlier_robust_simga).reset_index(drop=True)
 .groupby('test_name')['value'].mean()
)
```
#### Problem description

When I run this code my grouped (by test name) means come out to some value which is identical for all tests like this. These are not correct values for the dataset.

```
test_name
CGain_13250    11.623241
CGain_14250    11.623241
CGain_15250    11.623241
IDLNA          11.623241
IDLO           11.623241
IGX            11.623241
IGX_leak       11.623241
LOIN_GND       11.623241
RFIN_GND       11.623241
VDIn_leak      11.623241
VDIp_leak      11.623241
VDQn_leak      11.623241
VDQp_leak      11.623241
Name: value, dtype: float64
```
This problem only arises when I use the `filter_non_electrical_tests` method first. If I flip the order to say this

```python
(pd.read_csv('{}_test_data.csv'.format("TGC2668-SM"))
 .groupby('test_name').apply(filter_outlier_robust_simga).reset_index(drop=True)
 .pipe(filter_non_electrical_tests)  
 .groupby('test_name')['value'].mean()
)
``` 

than the output yields

```
test_name
CGain_13250    1.162324e+01
CGain_14250    1.139102e+01
CGain_15250    1.387552e+01
IDLNA          9.732629e-02
IDLO           7.729368e-02
IGX            7.262003e-07
IGX_leak       1.710862e-07
LOIN_GND      -1.274320e-09
RFIN_GND      -2.504888e-08
VDIn_leak     -3.919620e-08
VDIp_leak     -2.911678e-08
VDQn_leak     -6.241469e-08
VDQp_leak     -3.610917e-08
Name: value, dtype: float64
```

#### Expected Output

I would expect both orders of filter to arrive at the same result in this instance.

#### Output of ``pd.show_versions()``

<details>

commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.0-25-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.22.0
pytest: 3.3.0
pip: 9.0.1
setuptools: 36.5.0.post20170921
Cython: None
numpy: 1.14.0
scipy: None
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: None
pymysql: 0.7.11.None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

</details>
