`df.to_csv` on python3 throws `TypeError: a bytes-like object is required, not 'str'`
The following code throws that error: 

```
In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: df = pd.DataFrame(np.random.randn(10, 5), columns=['a', 'b', 'c', 'd', 'e'])
In [4]: import tempfile
In [5]: tf = tempfile.NamedTemporaryFile()
In [6]: df.to_csv(tf)
```

Am I missing something? 
