How can I get/save Pandas DataFrame help content?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Wed Dec 16 23:09:03 EST 2015
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
More information about the Python-list
mailing list