6
6
pandas arrays, scalars, and data types
7
7
======================================
8
8
9
+ *******
10
+ Objects
11
+ *******
12
+
9
13
.. currentmodule :: pandas
10
14
11
15
For most data types, pandas uses NumPy arrays as the concrete
@@ -40,8 +44,8 @@ stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFra
40
44
41
45
.. _api.arrays.datetime :
42
46
43
- Datetime data
44
- -------------
47
+ Datetimes
48
+ ---------
45
49
46
50
NumPy cannot natively represent timezone-aware datetimes. pandas supports this
47
51
with the :class: `arrays.DatetimeArray ` extension array, which can hold timezone-naive
@@ -161,8 +165,8 @@ If the data are timezone-aware, then every value in the array must have the same
161
165
162
166
.. _api.arrays.timedelta :
163
167
164
- Timedelta data
165
- --------------
168
+ Timedeltas
169
+ ----------
166
170
167
171
NumPy can natively represent timedeltas. pandas provides :class: `Timedelta `
168
172
for symmetry with :class: `Timestamp `.
@@ -216,8 +220,8 @@ A collection of :class:`Timedelta` may be stored in a :class:`TimedeltaArray`.
216
220
217
221
.. _api.arrays.period :
218
222
219
- Timespan data
220
- -------------
223
+ Periods
224
+ -------
221
225
222
226
pandas represents spans of times as :class: `Period ` objects.
223
227
@@ -284,8 +288,8 @@ Every period in a :class:`arrays.PeriodArray` must have the same ``freq``.
284
288
285
289
.. _api.arrays.interval :
286
290
287
- Interval data
288
- -------------
291
+ Intervals
292
+ ---------
289
293
290
294
Arbitrary intervals can be represented as :class: `Interval ` objects.
291
295
@@ -379,8 +383,8 @@ pandas provides this through :class:`arrays.IntegerArray`.
379
383
380
384
.. _api.arrays.categorical :
381
385
382
- Categorical data
383
- ----------------
386
+ Categoricals
387
+ ------------
384
388
385
389
pandas defines a custom data type for representing data that can take only a
386
390
limited, fixed set of values. The dtype of a :class: `Categorical ` can be described by
@@ -444,8 +448,8 @@ data. See :ref:`api.series.cat` for more.
444
448
445
449
.. _api.arrays.sparse :
446
450
447
- Sparse data
448
- -----------
451
+ Sparse
452
+ ------
449
453
450
454
Data where a single value is repeated many times (e.g. ``0 `` or ``NaN ``) may
451
455
be stored efficiently as a :class: `arrays.SparseArray `.
@@ -469,8 +473,8 @@ and methods if the :class:`Series` contains sparse values. See
469
473
470
474
.. _api.arrays.string :
471
475
472
- Text data
473
- ---------
476
+ Strings
477
+ -------
474
478
475
479
When working with text data, where each valid element is a string or missing,
476
480
we recommend using :class: `StringDtype ` (with the alias ``"string" ``).
@@ -494,8 +498,8 @@ See :ref:`api.series.str` for more.
494
498
495
499
.. _api.arrays.bool :
496
500
497
- Boolean data with missing values
498
- --------------------------------
501
+ Nullable Boolean
502
+ ----------------
499
503
500
504
The boolean dtype (with the alias ``"boolean" ``) provides support for storing
501
505
boolean data (``True ``, ``False ``) with missing values, which is not possible
@@ -525,3 +529,72 @@ with a bool :class:`numpy.ndarray`.
525
529
DatetimeTZDtype.tz
526
530
PeriodDtype.freq
527
531
IntervalDtype.subtype
532
+
533
+ *********
534
+ Utilities
535
+ *********
536
+
537
+ Constructors
538
+ ------------
539
+ .. autosummary ::
540
+ :toctree: api/
541
+
542
+ api.types.union_categoricals
543
+ api.types.infer_dtype
544
+ api.types.pandas_dtype
545
+
546
+ Data type introspection
547
+ ~~~~~~~~~~~~~~~~~~~~~~~
548
+ .. autosummary ::
549
+ :toctree: api/
550
+
551
+ api.types.is_bool_dtype
552
+ api.types.is_categorical_dtype
553
+ api.types.is_complex_dtype
554
+ api.types.is_datetime64_any_dtype
555
+ api.types.is_datetime64_dtype
556
+ api.types.is_datetime64_ns_dtype
557
+ api.types.is_datetime64tz_dtype
558
+ api.types.is_extension_type
559
+ api.types.is_extension_array_dtype
560
+ api.types.is_float_dtype
561
+ api.types.is_int64_dtype
562
+ api.types.is_integer_dtype
563
+ api.types.is_interval_dtype
564
+ api.types.is_numeric_dtype
565
+ api.types.is_object_dtype
566
+ api.types.is_period_dtype
567
+ api.types.is_signed_integer_dtype
568
+ api.types.is_string_dtype
569
+ api.types.is_timedelta64_dtype
570
+ api.types.is_timedelta64_ns_dtype
571
+ api.types.is_unsigned_integer_dtype
572
+ api.types.is_sparse
573
+
574
+ Iterable introspection
575
+ ~~~~~~~~~~~~~~~~~~~~~~
576
+ .. autosummary ::
577
+ :toctree: api/
578
+
579
+ api.types.is_dict_like
580
+ api.types.is_file_like
581
+ api.types.is_list_like
582
+ api.types.is_named_tuple
583
+ api.types.is_iterator
584
+
585
+ Scalar introspection
586
+ ~~~~~~~~~~~~~~~~~~~~
587
+ .. autosummary ::
588
+ :toctree: api/
589
+
590
+ api.types.is_bool
591
+ api.types.is_categorical
592
+ api.types.is_complex
593
+ api.types.is_float
594
+ api.types.is_hashable
595
+ api.types.is_integer
596
+ api.types.is_interval
597
+ api.types.is_number
598
+ api.types.is_re
599
+ api.types.is_re_compilable
600
+ api.types.is_scalar
0 commit comments