Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expand data table representation #62362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AnandMukherjee2004 wants to merge 12 commits into pandas-dev:main
base: main
Choose a base branch
Loading
from AnandMukherjee2004:expand-data-table-representation
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
12 commits
Select commit Hold shift + click to select a range
aa0804f
DOC: Clarify parentheses vs. brackets usage (GH#62314)
AnandMukherjee2004 Sep 15, 2025
ada92d7
DOC: Clarify parentheses vs. brackets usage (GH#62314) updated
AnandMukherjee2004 Sep 16, 2025
41272b9
DOC: Clarify parentheses vs. brackets usage (GH#62314) updated
AnandMukherjee2004 Sep 16, 2025
8c77d05
DOC: Clarify parentheses vs. brackets usage (GH#62314) updated
AnandMukherjee2004 Sep 16, 2025
fac8e7c
DOC: Clarify parentheses vs. brackets usage (GH#62314) updated
AnandMukherjee2004 Sep 16, 2025
689b069
DOC: Fix trailing whitespace and end-of-file issues (pre-commit CI)
AnandMukherjee2004 Sep 16, 2025
a1feaab
DOC: Fix trailing whitespace and end-of-file issues (pre-commit CI)
AnandMukherjee2004 Sep 16, 2025
2c658b1
DOC: Fix trailing whitespace and end-of-file issues (pre-commit CI)
AnandMukherjee2004 Sep 16, 2025
cf1e395
DOC: Fix trailing whitespace and end-of-file issues (pre-commit CI)
AnandMukherjee2004 Sep 16, 2025
8537736
DOC: expand data table diagram and add explanation of indexes to tuto...
AnandMukherjee2004 Sep 17, 2025
2399a2e
DOC: expand data table diagram and add explanation of indexes to tuto...
AnandMukherjee2004 Sep 17, 2025
f840b61
Merge branch 'main' into expand-data-table-representation
AnandMukherjee2004 Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/_static/schemas/01_dataframe.svg
View file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[フレーム]
43 changes: 43 additions & 0 deletions doc/source/getting_started/index.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,49 @@ Data sets often contain more than just numerical data. pandas provides a wide ra

:ref:`To user guide <text>`

.. raw:: html

</span>
</div>
</div>
</div>
</div>

<div class="card tutorial-card">
<div class="card-header collapsed card-link" data-bs-toggle="collapse" data-bs-target="#collapseEleven">
<div class="d-flex flex-row tutorial-card-header-1">
<div class="d-flex flex-row tutorial-card-header-2">
<button class="btn btn-dark btn-sm"></button>
How to use parentheses vs square brackets?
</div>
<span class="badge gs-badge-link">

:ref:`Straight to tutorial...<10min_tut_11_brackets_vs_parenthesis>`

.. raw:: html

</span>
</div>
</div>
<div id="collapseEleven" class="collapse" data-parent="#accordion">
<div class="card-body">

Understanding the difference between parentheses and square brackets is crucial for pandas users. Parentheses are used for function calls and grouping, while square brackets are for indexing and selection.

.. raw:: html

<div class="d-flex flex-row">
<span class="badge gs-badge-link">

:ref:`To introduction tutorial <10min_tut_11_brackets_vs_parenthesis>`

.. raw:: html

</span>
<span class="badge gs-badge-link">

:ref:`To user guide <indexing>`

.. raw:: html

</span>
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ documentation.
pandas data table representation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. image:: ../../_static/schemas/01_table_dataframe.svg
.. image:: ../../_static/schemas/01_dataframe.svg
:align: center

.. raw:: html
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _10min_tut_11_brackets_vs_parenthesis:

Parentheses vs. Square Brackets in Python and pandas
====================================================

In both Python and pandas, it is important to understand the difference between parentheses ``()`` and square brackets ``[]``:

- **Parentheses** are used to call functions and methods. For example, ``df.mean()`` calculates the mean of a DataFrame. Parentheses are also used to group expressions, such as ``(a + b) * c``, or to create tuples: ``(1, 2, 3)``.
- **Square brackets** are used for indexing, selecting data, and defining lists. In pandas, you use square brackets to select columns or filter data—for instance, ``df['A']`` selects column ``A``, while ``df[0:3]`` selects rows by position. In standard Python, square brackets are also used to define a list, as in ``my_list = [1, 2, 3]``.

Remember: Use ``[]`` for selection or indexing, and ``()`` for calling functions or grouping expressions.

For more explanation, see `Brackets in Python and pandas <https://python-public-policy.afeld.me/en/columbia/brackets.html>`__.
1 change: 1 addition & 0 deletions doc/source/getting_started/intro_tutorials/index.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Getting started tutorials
08_combine_dataframes
09_timeseries
10_text_data
11_brackets_vs_parenthesis
6 changes: 6 additions & 0 deletions package-lock.json
View file Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

AltStyle によって変換されたページ (->オリジナル) /