Skip to content

Commit 9d22a77

Browse files
committed
merge in main that now has offsets
2 parents 773e808 + e4162cd commit 9d22a77

File tree

167 files changed

+3836
-1981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3836
-1981
lines changed

.github/workflows/posix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
pattern: ["not single_cpu", "single_cpu"]
2929
# Don't test pyarrow v2/3: Causes timeouts in read_csv engine
3030
# even if tests are skipped/xfailed
31-
pyarrow_version: ["5", "6", "7"]
31+
pyarrow_version: ["5", "7"]
3232
include:
3333
- env_file: actions-38-downstream_compat.yaml
3434
pattern: "not slow and not network and not single_cpu"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ repos:
178178
language: python
179179
files: ^pandas/core/generic\.py$
180180
- id: pandas-errors-documented
181-
name: Ensure pandas errors are documented in doc/source/reference/general_utility_functions.rst
181+
name: Ensure pandas errors are documented in doc/source/reference/testing.rst
182182
entry: python scripts/pandas_errors_documented.py
183183
language: python
184184
files: ^pandas/errors/__init__.py$

asv_bench/benchmarks/groupby.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
method_blocklist = {
2020
"object": {
21+
"diff",
2122
"median",
2223
"prod",
2324
"sem",
@@ -405,7 +406,7 @@ class GroupByMethods:
405406

406407
param_names = ["dtype", "method", "application", "ncols"]
407408
params = [
408-
["int", "float", "object", "datetime", "uint"],
409+
["int", "int16", "float", "object", "datetime", "uint"],
409410
[
410411
"all",
411412
"any",
@@ -417,6 +418,7 @@ class GroupByMethods:
417418
"cumprod",
418419
"cumsum",
419420
"describe",
421+
"diff",
420422
"ffill",
421423
"first",
422424
"head",
@@ -478,7 +480,7 @@ def setup(self, dtype, method, application, ncols):
478480
values = rng.take(taker, axis=0)
479481
if dtype == "int":
480482
key = np.random.randint(0, size, size=size)
481-
elif dtype == "uint":
483+
elif dtype in ("int16", "uint"):
482484
key = np.random.randint(0, size, size=size, dtype=dtype)
483485
elif dtype == "float":
484486
key = np.concatenate(

asv_bench/benchmarks/indexing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,24 @@ def setup(self):
290290
self.dti = dti
291291
self.dti2 = dti2
292292

293+
index = np.random.choice(dti, 10000, replace=True)
294+
df = DataFrame(index=index, data={"a": 1})
295+
df_sort = df.sort_index()
296+
self.df = df
297+
self.df_sort = df_sort
298+
293299
def time_get_indexer_mismatched_tz(self):
294300
# reached via e.g.
295301
# ser = Series(range(len(dti)), index=dti)
296302
# ser[dti2]
297303
self.dti.get_indexer(self.dti2)
298304

305+
def time_loc_unsorted(self):
306+
self.df.loc["2016-6-11"]
307+
308+
def time_loc_sorted(self):
309+
self.df_sort.loc["2016-6-11"]
310+
299311

300312
class CategoricalIndexIndexing:
301313

ci/run_tests.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ if [[ "$PATTERN" ]]; then
3030
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
3131
fi
3232

33-
if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then
34-
PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/plotting/"
35-
fi
36-
3733
echo $PYTEST_CMD
3834
sh -c "$PYTEST_CMD"
3935

12 KB
Loading
8.51 KB
Loading

doc/source/development/contributing_environment.rst

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,28 @@ with a full pandas development environment.
2626

2727
**Docker Commands**
2828

29-
Pass your GitHub username in the ``DockerFile`` to use your own fork::
29+
Build the Docker image::
3030

3131
# Build the image pandas-yourname-env
3232
docker build --tag pandas-yourname-env .
33-
# Run a container and bind your local forked repo, pandas-yourname, to the container
34-
docker run -it --rm -v path-to-pandas-yourname:/home/pandas-yourname pandas-yourname-env
33+
# Or build the image by passing your GitHub username to use your own fork
34+
docker build --build-arg gh_username=yourname --tag pandas-yourname-env .
3535

36-
Even easier, you can integrate Docker with the following IDEs:
36+
Run Container::
37+
38+
# Run a container and bind your local repo to the container
39+
docker run -it -w /home/pandas --rm -v path-to-local-pandas-repo:/home/pandas pandas-yourname-env
40+
41+
.. note::
42+
If you bind your local repo for the first time, you have to build the C extensions afterwards.
43+
Run the following command inside the container::
44+
45+
python setup.py build_ext -j 4
46+
47+
You need to rebuild the C extensions anytime the Cython code in ``pandas/_libs`` changes.
48+
This most frequently occurs when changing or merging branches.
49+
50+
*Even easier, you can integrate Docker with the following IDEs:*
3751

3852
**Visual Studio Code**
3953

@@ -47,11 +61,6 @@ Enable Docker support and use the Services tool window to build and manage image
4761
run and interact with containers.
4862
See https://www.jetbrains.com/help/pycharm/docker.html for details.
4963

50-
Note that you might need to rebuild the C extensions if/when you merge with upstream/main using::
51-
52-
python setup.py build_ext -j 4
53-
54-
5564
Creating an environment without Docker
5665
---------------------------------------
5766

doc/source/reference/arrays.rst

Lines changed: 89 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
pandas arrays, scalars, and data types
77
======================================
88

9+
*******
10+
Objects
11+
*******
12+
913
.. currentmodule:: pandas
1014

1115
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
4044

4145
.. _api.arrays.datetime:
4246

43-
Datetime data
44-
-------------
47+
Datetimes
48+
---------
4549

4650
NumPy cannot natively represent timezone-aware datetimes. pandas supports this
4751
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
161165

162166
.. _api.arrays.timedelta:
163167

164-
Timedelta data
165-
--------------
168+
Timedeltas
169+
----------
166170

167171
NumPy can natively represent timedeltas. pandas provides :class:`Timedelta`
168172
for symmetry with :class:`Timestamp`.
@@ -216,8 +220,8 @@ A collection of :class:`Timedelta` may be stored in a :class:`TimedeltaArray`.
216220

217221
.. _api.arrays.period:
218222

219-
Timespan data
220-
-------------
223+
Periods
224+
-------
221225

222226
pandas represents spans of times as :class:`Period` objects.
223227

@@ -284,8 +288,8 @@ Every period in a :class:`arrays.PeriodArray` must have the same ``freq``.
284288

285289
.. _api.arrays.interval:
286290

287-
Interval data
288-
-------------
291+
Intervals
292+
---------
289293

290294
Arbitrary intervals can be represented as :class:`Interval` objects.
291295

@@ -379,8 +383,8 @@ pandas provides this through :class:`arrays.IntegerArray`.
379383

380384
.. _api.arrays.categorical:
381385

382-
Categorical data
383-
----------------
386+
Categoricals
387+
------------
384388

385389
pandas defines a custom data type for representing data that can take only a
386390
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.
444448

445449
.. _api.arrays.sparse:
446450

447-
Sparse data
448-
-----------
451+
Sparse
452+
------
449453

450454
Data where a single value is repeated many times (e.g. ``0`` or ``NaN``) may
451455
be stored efficiently as a :class:`arrays.SparseArray`.
@@ -469,8 +473,8 @@ and methods if the :class:`Series` contains sparse values. See
469473

470474
.. _api.arrays.string:
471475

472-
Text data
473-
---------
476+
Strings
477+
-------
474478

475479
When working with text data, where each valid element is a string or missing,
476480
we recommend using :class:`StringDtype` (with the alias ``"string"``).
@@ -494,8 +498,8 @@ See :ref:`api.series.str` for more.
494498

495499
.. _api.arrays.bool:
496500

497-
Boolean data with missing values
498-
--------------------------------
501+
Nullable Boolean
502+
----------------
499503

500504
The boolean dtype (with the alias ``"boolean"``) provides support for storing
501505
boolean data (``True``, ``False``) with missing values, which is not possible
@@ -525,3 +529,72 @@ with a bool :class:`numpy.ndarray`.
525529
DatetimeTZDtype.tz
526530
PeriodDtype.freq
527531
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

doc/source/reference/general_functions.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,3 @@ Hashing
7878

7979
util.hash_array
8080
util.hash_pandas_object
81-
82-
Testing
83-
~~~~~~~
84-
.. autosummary::
85-
:toctree: api/
86-
87-
test

0 commit comments

Comments
 (0)