Skip to content

Commit 1fe41f5

Browse files
Revert or adjust some misfitting bracket notations as reviewed
1 parent 66a64e6 commit 1fe41f5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

doc/source/getting_started/10min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Getting
170170
~~~~~~~
171171

172172
Selecting a single column, which yields a ``Series``,
173-
equivalent to ``df['A']``:
173+
equivalent to ``d.A``:
174174

175175
.. ipython:: python
176176

doc/source/user_guide/enhancingperf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ These operations are supported by :func:`pandas.eval`:
475475
* Comparison operations, including chained comparisons, e.g., ``2 < df < df2``
476476
* Boolean operations, e.g., ``df < df2 and df3 < df4 or not df_bool``
477477
* ``list`` and ``tuple`` literals, e.g., ``[1, 2]`` or ``(1, 2)``
478-
* Attribute access, e.g., ``df['a']``
478+
* Attribute access, e.g., ``df.a``
479479
* Subscript expressions, e.g., ``df[0]``
480480
* Simple variable evaluation, e.g., ``pd.eval('df')`` (this is not very useful)
481481
* Math functions: `sin`, `cos`, `exp`, `log`, `expm1`, `log1p`,

doc/source/user_guide/indexing.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ as an attribute:
206206
207207
.. warning::
208208

209-
- You can use this access only if the index element is a valid Python identifier, e.g. ``s.1`` is not allowed, but neither is ``s['1']``.
209+
- You can use this access only if the index element is a valid Python identifier, e.g. ``s.1`` is not allowed.
210210
See `here for an explanation of valid identifiers
211211
<https://docs.python.org/3/reference/lexical_analysis.html#identifiers>`__.
212212

@@ -1362,8 +1362,10 @@ Of course, expressions can be arbitrarily complex too:
13621362
shorter = df.query('a < b < c and (not bools) or bools > 2')
13631363
13641364
# equivalent in pure Python
1365-
longer = df[(df['a'] < df['b']) & (df['b'] < df['c'])
1366-
& (~df['bools']) | (df['bools'] > 2)]
1365+
longer = df[(df['a'] < df['b'])
1366+
& (df['b'] < df['c'])
1367+
& (~df['bools'])
1368+
| (df['bools'] > 2)]
13671369
13681370
shorter
13691371
longer

0 commit comments

Comments
 (0)