@@ -23,11 +23,11 @@ Categorical Data
23
23
.. versionadded :: 0.15
24
24
25
25
.. note ::
26
- While there was in `pandas.Categorical ` in earlier versions, the ability to use
26
+ While there was `pandas.Categorical ` in earlier versions, the ability to use
27
27
categorical data in `Series ` and `DataFrame ` is new.
28
28
29
29
30
- This is a introduction to pandas categorical data type, including a short comparison
30
+ This is an introduction to pandas categorical data type, including a short comparison
31
31
with R's ``factor ``.
32
32
33
33
`Categoricals ` are a pandas data type, which correspond to categorical variables in
@@ -276,7 +276,7 @@ Sorting and Order
276
276
277
277
.. warning ::
278
278
279
- The default for construction has change in v0.16.0 to ``ordered=False ``, from the prior implicit ``ordered=True ``
279
+ The default for construction has changed in v0.16.0 to ``ordered=False ``, from the prior implicit ``ordered=True ``
280
280
281
281
If categorical data is ordered (``s.cat.ordered == True ``), then the order of the categories has a
282
282
meaning and certain operations are possible. If the categorical is unordered, ``.min()/.max() `` will raise a `TypeError `.
@@ -347,15 +347,15 @@ Multi Column Sorting
347
347
~~~~~~~~~~~~~~~~~~~~
348
348
349
349
A categorical dtyped column will partcipate in a multi-column sort in a similar manner to other columns.
350
- The ordering of the categorical is determined by the ``categories `` of that columns .
350
+ The ordering of the categorical is determined by the ``categories `` of that column .
351
351
352
352
.. ipython :: python
353
353
354
- dfs = DataFrame({' A' : Categorical(list (' bbeebbaa' ),categories = [' e' ,' a' ,' b' ],ordered = True ),
354
+ dfs = DataFrame({' A' : Categorical(list (' bbeebbaa' ), categories = [' e' ,' a' ,' b' ], ordered = True ),
355
355
' B' : [1 ,2 ,1 ,2 ,2 ,1 ,2 ,1 ] })
356
- dfs.sort([' A' ,' B' ])
356
+ dfs.sort([' A' , ' B' ])
357
357
358
- Reordering the ``categories ``, changes a future sort.
358
+ Reordering the ``categories `` changes a future sort.
359
359
360
360
.. ipython :: python
361
361
@@ -380,7 +380,7 @@ categories or a categorical with any list-like object, will raise a TypeError.
380
380
381
381
Any "non-equality" comparisons of categorical data with a `Series `, `np.array `, `list ` or
382
382
categorical data with different categories or ordering will raise an `TypeError ` because custom
383
- categories ordering could be interpreted in two ways: one with taking in account the
383
+ categories ordering could be interpreted in two ways: one with taking into account the
384
384
ordering and one without.
385
385
386
386
.. ipython :: python
@@ -471,7 +471,7 @@ Data munging
471
471
------------
472
472
473
473
The optimized pandas data access methods ``.loc ``, ``.iloc ``, ``.ix `` ``.at ``, and ``.iat ``,
474
- work as normal, the only difference is the return type (for getting) and
474
+ work as normal. The only difference is the return type (for getting) and
475
475
that only values already in `categories ` can be assigned.
476
476
477
477
Getting
@@ -707,8 +707,8 @@ an ``object`` dtype is a constant times the length of the data.
707
707
708
708
.. note ::
709
709
710
- If the number of categories approaches the length of the data, the ``Categorical `` will use nearly (or more) memory than an
711
- equivalent ``object `` dtype representation.
710
+ If the number of categories approaches the length of the data, the ``Categorical `` will use nearly the same or
711
+ more memory than an equivalent ``object `` dtype representation.
712
712
713
713
.. ipython :: python
714
714
0 commit comments