Skip to content

DOC: read_clipboard() failed for sphinx in dev-99ae9ce #4157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michaelaye opened this issue Jul 8, 2013 · 22 comments
Closed

DOC: read_clipboard() failed for sphinx in dev-99ae9ce #4157

michaelaye opened this issue Jul 8, 2013 · 22 comments
Labels
Milestone

Comments

@michaelaye
Copy link
Contributor

See here:
http://pandas.pydata.org/pandas-docs/dev/io.html#clipboard

and scroll to the clipboard section.
Line [1215] with read_clipboard() failed.

@jreback
Copy link
Contributor

jreback commented Jul 10, 2013

@changhiskhan can you take a look?

@hayd
Copy link
Contributor

hayd commented Jul 12, 2013

probable/possible cause #3848 ?

@jreback
Copy link
Contributor

jreback commented Jul 13, 2013

could possibly be numpy 1.6.2 related

that's what's building docs

and don't think we have any tests for the clipboard stuff

shall we add some?

@cpcloud
Copy link
Member

cpcloud commented Jul 13, 2013

should there be a raise there to make sure that TextParser gets non-empty input?

@jreback
Copy link
Contributor

jreback commented Jul 13, 2013

this should work, non empty is not an error per se
something else going on

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

@jreback should this pass?

class TestClipboard(unittest.TestCase):
    def setUp(self):
        self.data = DataFrame(randn(5, 3))

    def test_round_trip(self):
        self.data.to_clipboard()
        expected = self.data
        result = read_clipboard()
        tm.assert_frame_equal(expected, result)

currently fails b/c columns are read as strings not ints

also should probably not print out the name of the clipboard program

@jreback
Copy link
Contributor

jreback commented Jul 18, 2013

in linux world, works for me

In [1]: df = DataFrame(randn(10,2))

In [2]: df.to_clipboard()
/usr/bin/xclip

In [3]: pd.read_clipboard()
Out[3]: 
          0         1
0  0.086303  0.412240
1 -0.574764 -0.131086
2  0.633972  0.012292
3 -1.034044 -0.115232
4 -0.709054  0.040310
5 -0.307468  0.312964
6  0.673137 -0.700172
7  1.598500 -0.409174
8 -0.511669  0.123703
9  0.010648 -0.205798

In [4]: pd.read_clipboard().dtypes
Out[4]: 
0    float64
1    float64
dtype: object

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

what is the dtype of the column index, i get object bc they are strings, should be int

@jreback
Copy link
Contributor

jreback commented Jul 18, 2013

I think this is expected though; things are transmitted as 'text', and they I wouldn't expect the a numeric looking column to be necessarily converted

just test with ``columns=list('AB')`

In [1]: df = DataFrame(randn(10,2))

In [2]: df.columns.dtype
Out[2]: dtype('int64')

In [3]: df.to_clipboard()
/usr/bin/xclip

In [4]: pd.read_clipboard().dtypes
Out[4]: 
0    float64
1    float64
dtype: object

In [6]: pd.read_clipboard().columns.dtype
Out[6]: dtype('O')

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

ok...the index is converted though....

@jreback
Copy link
Contributor

jreback commented Jul 18, 2013

I don't think we convert columns by default.....even with csv...not sure though

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

ur right read_csv doesn't convert, my bad

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

good news: looks like i managed to repro something similar

https://travis-ci.org/cpcloud/pandas/builds/9213347

bad news: i'm not sure how to work around this

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

is there a way to trick X into thinking there's a display

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

this: http://en.wikipedia.org/wiki/Xvfb might work

@cpcloud
Copy link
Member

cpcloud commented Jul 18, 2013

if docs are being built on a headless machine you'll get this error, i'm not sure how the clipboard works in conjunction with X, i'll investigate later this evening

@cpcloud
Copy link
Member

cpcloud commented Jul 19, 2013

so this is not a numpy version issue, just wanted to point that out...@jreback should i mention this on the ML?

@jreback
Copy link
Contributor

jreback commented Jul 19, 2013

is it because its built headless or some other issue? go ahead and email what u know and solution

@cpcloud
Copy link
Member

cpcloud commented Jul 19, 2013

I think it's the headless issue. The clipboard requires an X server to be running and the DISPLAY variable to be set. Not sure if there are any more details. There might be some specific platform issues, but the travis docs solution works.

@cpcloud
Copy link
Member

cpcloud commented Jul 19, 2013

would i be heretical in suggesting that we move the documentation over to somewhere like http://readthedocs.org?

@cpcloud
Copy link
Member

cpcloud commented Jul 19, 2013

It would be much easier to fix doc issues

@wesm
Copy link
Member

wesm commented Jul 24, 2013

looking good now

@wesm wesm closed this as completed Jul 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants