fix issue 2926

This commit should fix [issue 2926](https://github.com/pydata/pandas/issues/2926).