Skip to content

Commit 4c9dc28

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into doc-decorator
2 parents 1caee82 + cd52502 commit 4c9dc28

File tree

435 files changed

+10650
-5749
lines changed

Some content is hidden

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

435 files changed

+10650
-5749
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!
44

5-
Our main contributing guide can be found [in this repo](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst) or [on the website](https://pandas-docs.github.io/pandas-docs-travis/development/contributing.html). If you do not want to read it in its entirety, we will summarize the main ways in which you can contribute and point to relevant sections of that document for further information.
5+
Our main contributing guide can be found [in this repo](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst) or [on the website](https://pandas.pydata.org/docs/dev/development/contributing.html). If you do not want to read it in its entirety, we will summarize the main ways in which you can contribute and point to relevant sections of that document for further information.
66

77
## Getting Started
88

.github/ISSUE_TEMPLATE.md

-29
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
3+
name: Bug Report
4+
about: Create a bug report to help us improve pandas
5+
title: "BUG:"
6+
labels: "Bug, Needs Triage"
7+
8+
---
9+
10+
- [ ] I have checked that this issue has not already been reported.
11+
12+
- [ ] I have confirmed this bug exists on the latest version of pandas.
13+
14+
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
15+
16+
---
17+
18+
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
19+
20+
#### Code Sample, a copy-pastable example
21+
22+
```python
23+
# Your code here
24+
25+
```
26+
27+
#### Problem description
28+
29+
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
30+
31+
#### Expected Output
32+
33+
#### Output of ``pd.show_versions()``
34+
35+
<details>
36+
37+
[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
38+
39+
</details>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
3+
name: Documentation Improvement
4+
about: Report wrong or missing documentation
5+
title: "DOC:"
6+
labels: "Docs, Needs Triage"
7+
8+
---
9+
10+
#### Location of the documentation
11+
12+
[this should provide the location of the documentation, e.g. "pandas.read_csv" or the URL of the documentation, e.g. "https://dev.pandas.io/docs/reference/api/pandas.read_csv.html"]
13+
14+
**Note**: You can check the latest versions of the docs on `master` [here](https://pandas.pydata.org/docs/dev/).
15+
16+
#### Documentation problem
17+
18+
[this should provide a description of what documentation you believe needs to be fixed/improved]
19+
20+
#### Suggested fix for documentation
21+
22+
[this should explain the suggested fix and **why** it's better than the existing documentation]
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
3+
name: Feature Request
4+
about: Suggest an idea for pandas
5+
title: "ENH:"
6+
labels: "Enhancement, Needs Triage"
7+
8+
---
9+
10+
#### Is your feature request related to a problem?
11+
12+
[this should provide a description of what the problem is, e.g. "I wish I could use pandas to do [...]"]
13+
14+
#### Describe the solution you'd like
15+
16+
[this should provide a description of the feature request, e.g. "`DataFrame.foo` should get a new parameter `bar` that [...]", try to write a docstring for the desired feature]
17+
18+
#### API breaking implications
19+
20+
[this should provide a description of how this feature will affect the API]
21+
22+
#### Describe alternatives you've considered
23+
24+
[this should provide a description of any alternative solutions or features you've considered]
25+
26+
#### Additional context
27+
28+
[add any other context, code examples, or references to existing implementations about the feature request here]
29+
30+
```python
31+
# Your code here, if applicable
32+
33+
```
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
3+
name: Submit Question
4+
about: Ask a general question about pandas
5+
title: "QST:"
6+
labels: "Usage Question, Needs Triage"
7+
8+
---
9+
10+
- [ ] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.
11+
12+
- [ ] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).
13+
14+
---
15+
16+
#### Question about pandas
17+
18+
**Note**: If you'd still like to submit a question, please read [this guide](
19+
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your question.
20+
21+
```python
22+
# Your code here, if applicable
23+
24+
```

.github/workflows/ci.yml

+9-23
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,18 @@ jobs:
125125
- name: Check ipython directive errors
126126
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
127127

128-
- name: Install Rclone
129-
run: sudo apt install rclone -y
130-
if: github.event_name == 'push'
131-
132-
- name: Set up Rclone
128+
- name: Install ssh key
133129
run: |
134-
CONF=$HOME/.config/rclone/rclone.conf
135-
mkdir -p `dirname $CONF`
136-
echo "[ovh_host]" > $CONF
137-
echo "type = swift" >> $CONF
138-
echo "env_auth = false" >> $CONF
139-
echo "auth_version = 3" >> $CONF
140-
echo "auth = https://auth.cloud.ovh.net/v3/" >> $CONF
141-
echo "endpoint_type = public" >> $CONF
142-
echo "tenant_domain = default" >> $CONF
143-
echo "tenant = 2977553886518025" >> $CONF
144-
echo "domain = default" >> $CONF
145-
echo "user = w4KGs3pmDxpd" >> $CONF
146-
echo "key = ${{ secrets.ovh_object_store_key }}" >> $CONF
147-
echo "region = BHS" >> $CONF
130+
mkdir -m 700 -p ~/.ssh
131+
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
132+
chmod 600 ~/.ssh/id_rsa
133+
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
148134
if: github.event_name == 'push'
149135

150-
- name: Sync web with OVH
151-
run: rclone sync --exclude pandas-docs/** web/build ovh_host:prod
136+
- name: Upload web
137+
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
152138
if: github.event_name == 'push'
153139

154-
- name: Sync dev docs with OVH
155-
run: rclone sync doc/build/html ovh_host:prod/pandas-docs/dev
140+
- name: Upload dev docs
141+
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
156142
if: github.event_name == 'push'

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# pandas: powerful Python data analysis toolkit
88
[![PyPI Latest Release](https://img.shields.io/pypi/v/pandas.svg)](https://pypi.org/project/pandas/)
99
[![Conda Latest Release](https://anaconda.org/conda-forge/pandas/badges/version.svg)](https://anaconda.org/anaconda/pandas/)
10+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134)
1011
[![Package Status](https://img.shields.io/pypi/status/pandas.svg)](https://pypi.org/project/pandas/)
1112
[![License](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/master/LICENSE)
1213
[![Travis Build Status](https://travis-ci.org/pandas-dev/pandas.svg?branch=master)](https://travis-ci.org/pandas-dev/pandas)
@@ -158,7 +159,7 @@ Most development discussion is taking place on github in this repo. Further, the
158159

159160
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
160161

161-
A detailed overview on how to contribute can be found in the **[contributing guide](https://dev.pandas.io/docs/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
162+
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
162163

163164
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
164165

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// followed by the pip installed packages).
4040
"matrix": {
4141
"numpy": [],
42-
"Cython": [],
42+
"Cython": ["0.29.16"],
4343
"matplotlib": [],
4444
"sqlalchemy": [],
4545
"scipy": [],

asv_bench/benchmarks/arithmetic.py

+17
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@ def time_frame_op_with_scalar(self, dtype, scalar, op):
5050
op(self.df, scalar)
5151

5252

53+
class OpWithFillValue:
54+
def setup(self):
55+
# GH#31300
56+
arr = np.arange(10 ** 6)
57+
df = DataFrame({"A": arr})
58+
ser = df["A"]
59+
60+
self.df = df
61+
self.ser = ser
62+
63+
def time_frame_op_with_fill_value_no_nas(self):
64+
self.df.add(self.df, fill_value=4)
65+
66+
def time_series_op_with_fill_value_no_nas(self):
67+
self.ser.add(self.ser, fill_value=4)
68+
69+
5370
class MixedFrameWithSeriesAxis0:
5471
params = [
5572
[

asv_bench/benchmarks/array.py

+18
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ def setup(self):
99
self.values_float = np.array([1.0, 0.0, 1.0, 0.0])
1010
self.values_integer = np.array([1, 0, 1, 0])
1111
self.values_integer_like = [1, 0, 1, 0]
12+
self.data = np.array([True, False, True, False])
13+
self.mask = np.array([False, False, True, False])
14+
15+
def time_constructor(self):
16+
pd.arrays.BooleanArray(self.data, self.mask)
1217

1318
def time_from_bool_array(self):
1419
pd.array(self.values_bool, dtype="boolean")
@@ -21,3 +26,16 @@ def time_from_integer_like(self):
2126

2227
def time_from_float_array(self):
2328
pd.array(self.values_float, dtype="boolean")
29+
30+
31+
class IntegerArray:
32+
def setup(self):
33+
self.values_integer = np.array([1, 0, 1, 0])
34+
self.data = np.array([1, 2, 3, 4], dtype="int64")
35+
self.mask = np.array([False, False, True, False])
36+
37+
def time_constructor(self):
38+
pd.arrays.IntegerArray(self.data, self.mask)
39+
40+
def time_from_integer_array(self):
41+
pd.array(self.values_integer, dtype="Int64")

asv_bench/benchmarks/finalize.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pandas as pd
2+
3+
4+
class Finalize:
5+
param_names = ["series", "frame"]
6+
params = [pd.Series, pd.DataFrame]
7+
8+
def setup(self, param):
9+
N = 1000
10+
obj = param(dtype=float)
11+
for i in range(N):
12+
obj.attrs[i] = i
13+
self.obj = obj
14+
15+
def time_finalize_micro(self, param):
16+
self.obj.__finalize__(self.obj, method="__finalize__")

asv_bench/benchmarks/groupby.py

+34
Original file line numberDiff line numberDiff line change
@@ -626,4 +626,38 @@ def time_first(self):
626626
self.df_nans.groupby("key").transform("first")
627627

628628

629+
class TransformEngine:
630+
def setup(self):
631+
N = 10 ** 3
632+
data = DataFrame(
633+
{0: [str(i) for i in range(100)] * N, 1: list(range(100)) * N},
634+
columns=[0, 1],
635+
)
636+
self.grouper = data.groupby(0)
637+
638+
def time_series_numba(self):
639+
def function(values, index):
640+
return values * 5
641+
642+
self.grouper[1].transform(function, engine="numba")
643+
644+
def time_series_cython(self):
645+
def function(values):
646+
return values * 5
647+
648+
self.grouper[1].transform(function, engine="cython")
649+
650+
def time_dataframe_numba(self):
651+
def function(values, index):
652+
return values * 5
653+
654+
self.grouper.transform(function, engine="numba")
655+
656+
def time_dataframe_cython(self):
657+
def function(values):
658+
return values * 5
659+
660+
self.grouper.transform(function, engine="cython")
661+
662+
629663
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/multiindex_object.py

+28
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,38 @@ def setup(self):
7474
],
7575
dtype=object,
7676
)
77+
self.other_mi_many_mismatches = MultiIndex.from_tuples(
78+
[
79+
(-7, 41),
80+
(-2, 3),
81+
(-0.7, 5),
82+
(0, 0),
83+
(0, 1.5),
84+
(0, 340),
85+
(0, 1001),
86+
(1, -4),
87+
(1, 20),
88+
(1, 1040),
89+
(432, -5),
90+
(432, 17),
91+
(439, 165.5),
92+
(998, -4),
93+
(998, 24065),
94+
(999, 865.2),
95+
(999, 1000),
96+
(1045, -843),
97+
]
98+
)
7799

78100
def time_get_indexer(self):
79101
self.mi_int.get_indexer(self.obj_index)
80102

103+
def time_get_indexer_and_backfill(self):
104+
self.mi_int.get_indexer(self.other_mi_many_mismatches, method="backfill")
105+
106+
def time_get_indexer_and_pad(self):
107+
self.mi_int.get_indexer(self.other_mi_many_mismatches, method="pad")
108+
81109
def time_is_monotonic(self):
82110
self.mi_int.is_monotonic
83111

0 commit comments

Comments
 (0)