0

R has several convenient functions like head(), summary() to show the content of an object concisely. What are the ways to show the content of python data object concisely? Thanks.

user1424739
  • 11,937
  • 17
  • 63
  • 152
  • `myObject.__dict__` will give you a dict representation of the object's fields and their values, if that's what you're after. It depends entirely on what you mean be "concisely" and what object you're talking about. –  Dec 05 '17 at 16:31
  • 1
    Well-written objects will implement `__repr__` in a nice way as to provide the caller with good information when they call `repr(o)`. – Jonathon Reinhart Dec 05 '17 at 16:32
  • Pandas has a [describe function](https://pandas.pydata.org/pandas-docs/stable/basics.html#summarizing-data-describe), similar to summary() in R – erocoar Dec 05 '17 at 16:37
  • @erocoar Does `numpy` has something to pandas' `describe()` function? – user1424739 Dec 11 '17 at 06:42
  • [this](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.describe.html) might be what you're looking for – erocoar Dec 11 '17 at 09:47

0 Answers0