Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100552 > unrolled thread
| Started by | Robert <rxjwg98@gmail.com> |
|---|---|
| First post | 2015-12-16 18:48 -0800 |
| Last post | 2015-12-17 10:27 +0100 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.python
How can I get/save Pandas DataFrame help content? Robert <rxjwg98@gmail.com> - 2015-12-16 18:48 -0800
Re: How can I get/save Pandas DataFrame help content? Chris Angelico <rosuav@gmail.com> - 2015-12-17 13:56 +1100
Re: How can I get/save Pandas DataFrame help content? Robert <rxjwg98@gmail.com> - 2015-12-16 19:20 -0800
Re: How can I get/save Pandas DataFrame help content? Chris Angelico <rosuav@gmail.com> - 2015-12-17 14:30 +1100
Re: How can I get/save Pandas DataFrame help content? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-12-17 15:09 +1100
Re: How can I get/save Pandas DataFrame help content? Robert Kern <robert.kern@gmail.com> - 2015-12-17 15:15 +0000
Re: How can I get/save Pandas DataFrame help content? Peter Otten <__peter__@web.de> - 2015-12-17 10:27 +0100
| From | Robert <rxjwg98@gmail.com> |
|---|---|
| Date | 2015-12-16 18:48 -0800 |
| Subject | How can I get/save Pandas DataFrame help content? |
| Message-ID | <9109f5a6-f6c7-4651-995e-2e8813c1f647@googlegroups.com> |
Hi, When I use Enthought/Canopy, help(DataFrame) has so much content that it exceeds the display buffer, i.e. its head is cut off as I go up to see it. I would like to know whether there is a way similar to Linux redirection to save the help DataFrame content to a file? I have search on-line Pandas DataFrame web page. Surprisingly, it has much less content than help(DataFrame) command. If there is no way to save the content to a file, do you know where I can get the full help DataFrame content on a web page? Thanks,
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-12-17 13:56 +1100 |
| Message-ID | <mailman.29.1450320969.30845.python-list@python.org> |
| In reply to | #100552 |
On Thu, Dec 17, 2015 at 1:48 PM, Robert <rxjwg98@gmail.com> wrote: > Hi, > > When I use Enthought/Canopy, help(DataFrame) has so much content that it > exceeds the display buffer, i.e. its head is cut off as I go up to see it. > I would like to know whether there is a way similar to Linux redirection to > save the help DataFrame content to a file? If you use command-line Python (by just running 'python' or 'python3' in your shell), you should be able to use help() with a More pager. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Robert <rxjwg98@gmail.com> |
|---|---|
| Date | 2015-12-16 19:20 -0800 |
| Message-ID | <da9c3aff-6e54-4c78-9801-b3477adedf70@googlegroups.com> |
| In reply to | #100553 |
On Wednesday, December 16, 2015 at 9:56:23 PM UTC-5, Chris Angelico wrote: > On Thu, Dec 17, 2015 at 1:48 PM, Robert <com> wrote: > > Hi, > > > > When I use Enthought/Canopy, help(DataFrame) has so much content that it > > exceeds the display buffer, i.e. its head is cut off as I go up to see it. > > I would like to know whether there is a way similar to Linux redirection to > > save the help DataFrame content to a file? > > If you use command-line Python (by just running 'python' or 'python3' > in your shell), you should be able to use help() with a More pager. > > ChrisA Thanks for this useful idea. I have tried with: help(DataFrame) | more NameError Traceback (most recent call last) <ipython-input-52-826956076b70> in <module>() ----> 1 help(DataFrame) | more NameError: name 'more' is not defined //////////// It is possible I misunderstand your method. Could you give me a little more description on it?
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-12-17 14:30 +1100 |
| Message-ID | <mailman.30.1450323045.30845.python-list@python.org> |
| In reply to | #100554 |
On Thu, Dec 17, 2015 at 2:20 PM, Robert <rxjwg98@gmail.com> wrote: > On Wednesday, December 16, 2015 at 9:56:23 PM UTC-5, Chris Angelico wrote: >> On Thu, Dec 17, 2015 at 1:48 PM, Robert <com> wrote: >> > Hi, >> > >> > When I use Enthought/Canopy, help(DataFrame) has so much content that it >> > exceeds the display buffer, i.e. its head is cut off as I go up to see it. >> > I would like to know whether there is a way similar to Linux redirection to >> > save the help DataFrame content to a file? >> >> If you use command-line Python (by just running 'python' or 'python3' >> in your shell), you should be able to use help() with a More pager. >> >> ChrisA > > Thanks for this useful idea. > I have tried with: > > help(DataFrame) | more > NameError Traceback (most recent call last) > <ipython-input-52-826956076b70> in <module>() > ----> 1 help(DataFrame) | more > > NameError: name 'more' is not defined > //////////// > It is possible I misunderstand your method. Could you give me a little more > description on it? Sorry for the confusion. You don't need to explicitly request the pager; the default interpreter configuration should include that. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2015-12-17 15:09 +1100 |
| Message-ID | <56723561$0$1596$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #100552 |
On Thursday 17 December 2015 13:48, Robert wrote:
> Hi,
>
> When I use Enthought/Canopy, help(DataFrame) has so much content that it
> exceeds the display buffer, i.e. its head is cut off as I go up to see it.
Step 1: report this as a bug to Enthought and/or the Python bug tracker.
help(DataFrame) should automatically choose a pager such as `less` on Linux
or equivalent (`more` I think?) on Windows.
Step 2: in the meantime, while you wait for Enthought to fix this, you can
try any of these:
(a) open the regular Python interactive interpreter (do you need help with
that?); once you have the >>> prompt, import the module that DataFrame
comes from, then run help:
import whatever
help(whatever.DataFrame)
The regular interactive interpreter ought to automatically pick a pager. If
it doesn't, that's a bug.
(b) At the shell prompt (most likely a $ or # prompt) run:
pydoc whatever.DataFrame
if necessarily piping it to the pager or file of your choice using your
shell's normal redirection syntax, e.g.:
pydoc whatever.DataFrame | less
(Remember, this is at the shell $ prompt, not the Python >>> prompt.)
(c) If your OS can't find "pydoc", try this instead:
python -m pydoc whatever.DataFrame
--
Steve
[toc] | [prev] | [next] | [standalone]
| From | Robert Kern <robert.kern@gmail.com> |
|---|---|
| Date | 2015-12-17 15:15 +0000 |
| Message-ID | <mailman.36.1450365381.30845.python-list@python.org> |
| In reply to | #100557 |
On 2015-12-17 04:09, Steven D'Aprano wrote: > On Thursday 17 December 2015 13:48, Robert wrote: > >> Hi, >> >> When I use Enthought/Canopy, help(DataFrame) has so much content that it >> exceeds the display buffer, i.e. its head is cut off as I go up to see it. > > > Step 1: report this as a bug to Enthought and/or the Python bug tracker. > help(DataFrame) should automatically choose a pager such as `less` on Linux > or equivalent (`more` I think?) on Windows. I suspect that he is using the embedded IPython console in the Canopy IDE, so it's more of an issue that help() knows that it's not in a true terminal so it doesn't page. If he had been using python at the terminal, help() would have indeed used the appropriate terminal pager. Robert, in the IPython console, you can also use a special syntax to get the content. The IPython console widget does know how to page this: In [1]: pandas.DataFrame? http://ipython.readthedocs.org/en/stable/interactive/reference.html#dynamic-object-information -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
[toc] | [prev] | [next] | [standalone]
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2015-12-17 10:27 +0100 |
| Message-ID | <mailman.32.1450344461.30845.python-list@python.org> |
| In reply to | #100552 |
Robert wrote: > Hi, > > When I use Enthought/Canopy, help(DataFrame) has so much content that it > exceeds the display buffer, i.e. its head is cut off as I go up to see it. > I would like to know whether there is a way similar to Linux redirection > to save the help DataFrame content to a file? > > I have search on-line Pandas DataFrame web page. Surprisingly, it has much > less content than help(DataFrame) command. > > If there is no way to save the content to a file, do you know where I can > get the full help DataFrame content on a web page? On the commandline start a webserver with python -m pydoc -p 8000 and then point your browser to http://localhost:8000/pandas.core.frame.html#DataFrame
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web