From be781a133c70d7268a8b4cdda3abd384b206aebe Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Sun, 17 Mar 2024 16:46:41 +0700 Subject: [PATCH] add note --- pandas/io/parsers/readers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 1ef2e65617c9b..5e9e7d0cf5ba8 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -195,6 +195,12 @@ class _read_shared(TypedDict, Generic[HashableT], total=False): parameter ignores commented lines and empty lines if ``skip_blank_lines=True``, so ``header=0`` denotes the first line of data rather than the first line of the file. + + When inferred from the file contents, headers are kept distinct from + each other by renaming duplicate names with a numeric suffix of the form + ``".{{count}}"`` starting from 1, e.g. ``"foo"`` and ``"foo.1"``. + Empty headers are named ``"Unnamed: {{i}}"`` or ``"Unnamed: {{i}}_level_{{level}}"`` + in the case of MultiIndex columns. names : Sequence of Hashable, optional Sequence of column labels to apply. If the file contains a header row, then you should explicitly pass ``header=0`` to override the column names.