Since I updated pandas from version 0.11 to 0.12, read_clipboard doesn't seem to work anymore:
import pandas as pd
df = pd.read_clipboard()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-6dead334eb54> in <module>()
----> 1 df = pd.read_clipboard()
C:Python33libsite-packagespandasioclipboard.py in read_clipboard(**kwargs)
16 from pandas.io.parsers import read_table
17 text = clipboard_get()
---> 18 return read_table(StringIO(text), **kwargs)
19
20
TypeError: initial_value must be str or None, not bytes
What I did was:
Open a csv file in Excel 2010
Copy a range of cells, including headers
Perform read_clipboard in iPython Qt console as described in above code block
After downgrading to 0.11, this procedure worked fine again. I'm using pandas for python 3.3 Win7 32 bit.
Is this a bug in pandas? Any suggestions on how to resolve this issue?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…