0

Is there a guide/instruction on how to read and understand a Python's documentation? As an example, help(pd.concat) produces the following text

concat(objs: Union[Iterable[Union[ForwardRef('DataFrame'), ForwardRef('Series')]], Mapping[Union[Hashable, NoneType], Union[ForwardRef('DataFrame'), ForwardRef('Series')]]], axis=0, join='outer', ignore_index: bool = False, keys=None, levels=None, names=None, verify_integrity: bool = False, sort: bool = False, copy: bool = True) -> Union[ForwardRef('DataFrame'), ForwardRef('Series')]
...
keys : sequence, default None
        If multiple levels passed, should contain tuples. Construct
        hierarchical index using the passed keys as the outermost level.
levels : list of sequences, default None
        Specific levels (unique values) to use for constructing a
        MultiIndex. Otherwise they will be inferred from the keys.

I had no ideas what it meant by keys and levels in the help documentation. Is the (specific) levels (in levels) the same as (multiple) levels (in keys)? Is the help documentation only meant for developers? Is there a dictionary/indexes for the arguments? Why can't the help documentation of a function have an example for each of its arguments?

Nemo
  • 1,124
  • 2
  • 16
  • 39

1 Answers1

1

for this kind of function. better read the documentation instead of doc. the doc is a concise summary due to space limit.

you may need the documentations, such as pd.concat

tomy0608
  • 317
  • 1
  • 9
  • Thanks, Tomy. The documentation is almost the same as the help doc. Although there were examples for `keys`, none for `levels`! – Nemo Dec 08 '20 at 04:38
  • if you are just looking for `pd.concat`. [this answer](https://stackoverflow.com/a/49620539/13837927) may help u :) – tomy0608 Dec 08 '20 at 05:57
  • I just used `pd.concat` as an example. A lot of time when reading either help or documentation, I couldn't follow the *explanation* for some arguments of the functions – Nemo Dec 08 '20 at 11:16