python - Pandas read_clipboard broken in pandas 0.12? -


since updated pandas version 0.11 0.12, read_clipboard doesn't seem work anymore:

import pandas pd  df = pd.read_clipboard() --------------------------------------------------------------------------- typeerror                                 traceback (most recent call last) <ipython-input-2-6dead334eb54> in <module>() ----> 1 df = pd.read_clipboard()  c:\python33\lib\site-packages\pandas\io\clipboard.py in read_clipboard(**kwargs)      16     pandas.io.parsers import read_table      17     text = clipboard_get() ---> 18     return read_table(stringio(text), **kwargs)      19       20   typeerror: initial_value must str or none, not bytes 

what did was:

  • open csv file in excel 2010

  • copy range of cells, including headers

  • perform read_clipboard in ipython qt console described in above code block

after downgrading 0.11, procedure worked fine again. i'm using pandas python 3.3 win7 32 bit.

is bug in pandas? suggestions on how resolve issue?

its bug in string presented py3; i'll fix in master, can local edit.

in c:\python33\lib\site-packages\pandas\io\clipboard.py

after text = clipboard_get()

add text = text.decode('utf-8')

apparently clipboard routine gives bytes (and not string) in py3


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -