Skip to content

Commit 5930781

Browse files
author
maxwasserman
committed
Re-merge
2 parents e0325f2 + 42ed4f1 commit 5930781

File tree

386 files changed

+12018
-9454
lines changed

Some content is hidden

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

386 files changed

+12018
-9454
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@
88

99
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution.]
1010

11+
**Note**: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
12+
13+
**Note**: Many problems can be resolved by simply upgrading `pandas` to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if `master` addresses this issue, but that is not necessary.
14+
15+
For documentation-related issues, you can check the latest versions of the docs on `master` here:
16+
17+
https://pandas-docs.github.io/pandas-docs-travis/
18+
19+
If the issue has not been resolved there, go ahead and file it in the issue tracker.
20+
1121
#### Expected Output
1222

1323
#### Output of ``pd.show_versions()``
1424

1525
<details>
16-
# Paste the output here pd.show_versions() here
26+
27+
[paste the output of ``pd.show_versions()`` here below this line]
1728

1829
</details>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] closes #xxxx
2-
- [ ] tests added / passed
3-
- [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
4-
- [ ] whatsnew entry
1+
- [ ] closes #xxxx
2+
- [ ] tests added / passed
3+
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
4+
- [ ] whatsnew entry

.pep8speaks.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# File : .pep8speaks.yml
2+
3+
scanner:
4+
diff_only: True # If True, errors caused by only the patch are shown
5+
6+
pycodestyle:
7+
max-line-length: 79
8+
ignore: # Errors and warnings to ignore
9+
- E731
10+
- E402

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ matrix:
3737
- JOB="3.5_OSX" TEST_ARGS="--skip-slow --skip-network"
3838
- dist: trusty
3939
env:
40-
- JOB="2.7_LOCALE" TEST_ARGS="--only-slow --skip-network" LOCALE_OVERRIDE="zh_CN.UTF-8"
40+
- JOB="2.7_LOCALE" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
4141
addons:
4242
apt:
4343
packages:
@@ -62,7 +62,7 @@ matrix:
6262
# In allow_failures
6363
- dist: trusty
6464
env:
65-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
65+
- JOB="2.7_SLOW" SLOW=true
6666
# In allow_failures
6767
- dist: trusty
6868
env:
@@ -82,7 +82,7 @@ matrix:
8282
allow_failures:
8383
- dist: trusty
8484
env:
85-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
85+
- JOB="2.7_SLOW" SLOW=true
8686
- dist: trusty
8787
env:
8888
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include LICENSE
33
include RELEASE.md
44
include README.rst
55
include setup.py
6+
include pyproject.toml
67

78
graft doc
89
prune doc/build

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
<tr>
5454
<td>Conda</td>
5555
<td>
56-
<a href="http://pandas.pydata.org">
56+
<a href="https://pandas.pydata.org">
5757
<img src="http://pubbadges.s3-website-us-east-1.amazonaws.com/pkgs-downloads-pandas.png" alt="conda default downloads" />
5858
</a>
5959
</td>
6060
</tr>
6161
<tr>
6262
<td>Conda-forge</td>
6363
<td>
64-
<a href="http://pandas.pydata.org">
64+
<a href="https://pandas.pydata.org">
6565
<img src="https://anaconda.org/conda-forge/pandas/badges/downloads.svg" alt="conda-forge downloads" />
6666
</a>
6767
</td>
@@ -123,31 +123,31 @@ Here are just a few of the things that pandas does well:
123123
moving window linear regressions, date shifting and lagging, etc.
124124

125125

126-
[missing-data]: http://pandas.pydata.org/pandas-docs/stable/missing_data.html#working-with-missing-data
127-
[insertion-deletion]: http://pandas.pydata.org/pandas-docs/stable/dsintro.html#column-selection-addition-deletion
128-
[alignment]: http://pandas.pydata.org/pandas-docs/stable/dsintro.html?highlight=alignment#intro-to-data-structures
129-
[groupby]: http://pandas.pydata.org/pandas-docs/stable/groupby.html#group-by-split-apply-combine
130-
[conversion]: http://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe
131-
[slicing]: http://pandas.pydata.org/pandas-docs/stable/indexing.html#slicing-ranges
132-
[fancy-indexing]: http://pandas.pydata.org/pandas-docs/stable/indexing.html#advanced-indexing-with-ix
133-
[subsetting]: http://pandas.pydata.org/pandas-docs/stable/indexing.html#boolean-indexing
134-
[merging]: http://pandas.pydata.org/pandas-docs/stable/merging.html#database-style-dataframe-joining-merging
135-
[joining]: http://pandas.pydata.org/pandas-docs/stable/merging.html#joining-on-index
136-
[reshape]: http://pandas.pydata.org/pandas-docs/stable/reshaping.html#reshaping-and-pivot-tables
137-
[pivot-table]: http://pandas.pydata.org/pandas-docs/stable/reshaping.html#pivot-tables-and-cross-tabulations
138-
[mi]: http://pandas.pydata.org/pandas-docs/stable/indexing.html#hierarchical-indexing-multiindex
139-
[flat-files]: http://pandas.pydata.org/pandas-docs/stable/io.html#csv-text-files
140-
[excel]: http://pandas.pydata.org/pandas-docs/stable/io.html#excel-files
141-
[db]: http://pandas.pydata.org/pandas-docs/stable/io.html#sql-queries
142-
[hdfstore]: http://pandas.pydata.org/pandas-docs/stable/io.html#hdf5-pytables
143-
[timeseries]: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#time-series-date-functionality
126+
[missing-data]: https://pandas.pydata.org/pandas-docs/stable/missing_data.html#working-with-missing-data
127+
[insertion-deletion]: https://pandas.pydata.org/pandas-docs/stable/dsintro.html#column-selection-addition-deletion
128+
[alignment]: https://pandas.pydata.org/pandas-docs/stable/dsintro.html?highlight=alignment#intro-to-data-structures
129+
[groupby]: https://pandas.pydata.org/pandas-docs/stable/groupby.html#group-by-split-apply-combine
130+
[conversion]: https://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe
131+
[slicing]: https://pandas.pydata.org/pandas-docs/stable/indexing.html#slicing-ranges
132+
[fancy-indexing]: https://pandas.pydata.org/pandas-docs/stable/indexing.html#advanced-indexing-with-ix
133+
[subsetting]: https://pandas.pydata.org/pandas-docs/stable/indexing.html#boolean-indexing
134+
[merging]: https://pandas.pydata.org/pandas-docs/stable/merging.html#database-style-dataframe-joining-merging
135+
[joining]: https://pandas.pydata.org/pandas-docs/stable/merging.html#joining-on-index
136+
[reshape]: https://pandas.pydata.org/pandas-docs/stable/reshaping.html#reshaping-and-pivot-tables
137+
[pivot-table]: https://pandas.pydata.org/pandas-docs/stable/reshaping.html#pivot-tables-and-cross-tabulations
138+
[mi]: https://pandas.pydata.org/pandas-docs/stable/indexing.html#hierarchical-indexing-multiindex
139+
[flat-files]: https://pandas.pydata.org/pandas-docs/stable/io.html#csv-text-files
140+
[excel]: https://pandas.pydata.org/pandas-docs/stable/io.html#excel-files
141+
[db]: https://pandas.pydata.org/pandas-docs/stable/io.html#sql-queries
142+
[hdfstore]: https://pandas.pydata.org/pandas-docs/stable/io.html#hdf5-pytables
143+
[timeseries]: https://pandas.pydata.org/pandas-docs/stable/timeseries.html#time-series-date-functionality
144144

145145
## Where to get it
146146
The source code is currently hosted on GitHub at:
147-
http://github.com/pandas-dev/pandas
147+
https://github.com/pandas-dev/pandas
148148

149149
Binary installers for the latest released version are available at the [Python
150-
package index](http://pypi.python.org/pypi/pandas/) and on conda.
150+
package index](https://pypi.python.org/pypi/pandas) and on conda.
151151

152152
```sh
153153
# conda
@@ -161,11 +161,11 @@ pip install pandas
161161

162162
## Dependencies
163163
- [NumPy](http://www.numpy.org): 1.7.0 or higher
164-
- [python-dateutil](http://labix.org/python-dateutil): 1.5 or higher
165-
- [pytz](http://pytz.sourceforge.net)
164+
- [python-dateutil](https://labix.org/python-dateutil): 1.5 or higher
165+
- [pytz](https://pythonhosted.org/pytz)
166166
- Needed for time zone support with ``pandas.date_range``
167167

168-
See the [full installation instructions](http://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
168+
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
169169
for recommended and optional dependencies.
170170

171171
## Installation from sources
@@ -197,13 +197,13 @@ mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs
197197
pip install -e .
198198
```
199199

200-
See the full instructions for [installing from source](http://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).
200+
See the full instructions for [installing from source](https://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).
201201

202202
## License
203-
BSD
203+
[BSD 3](LICENSE)
204204

205205
## Documentation
206-
The official documentation is hosted on PyData.org: http://pandas.pydata.org/pandas-docs/stable/
206+
The official documentation is hosted on PyData.org: https://pandas.pydata.org/pandas-docs/stable
207207

208208
The Sphinx documentation should provide a good starting point for learning how
209209
to use the library. Expect the docs to continue to expand as time goes on.
@@ -223,7 +223,7 @@ Most development discussion is taking place on github in this repo. Further, the
223223
## Contributing to pandas
224224
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
225225

226-
A detailed overview on how to contribute can be found in the **[contributing guide.](http://pandas.pydata.org/pandas-docs/stable/contributing.html)**
226+
A detailed overview on how to contribute can be found in the **[contributing guide.](https://pandas.pydata.org/pandas-docs/stable/contributing.html)**
227227

228228
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 [Difficulty Novice](https://github.com/pandas-dev/pandas/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty+Novice%22) where you could start out.
229229

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ install:
7272
- cmd: conda info -a
7373

7474
# create our env
75-
- cmd: conda create -n pandas python=%PYTHON_VERSION% cython pytest pytest-xdist
75+
- cmd: conda create -n pandas python=%PYTHON_VERSION% cython pytest>=3.1.0 pytest-xdist
7676
- cmd: activate pandas
7777
- SET REQ=ci\requirements-%PYTHON_VERSION%_WIN.run
7878
- cmd: echo "installing requirements from %REQ%"

asv_bench/asv.conf.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@
117117
// with results. If the commit is `null`, regression detection is
118118
// skipped for the matching benchmark.
119119
//
120-
// "regressions_first_commits": {
121-
// "some_benchmark": "352cdf", // Consider regressions only after this commit
122-
// "another_benchmark": null, // Skip regression detection altogether
123-
// }
120+
"regressions_first_commits": {
121+
".*": "v0.20.0"
122+
},
123+
"regression_thresholds": {
124+
".*": 0.05
125+
}
124126
}

asv_bench/benchmarks/period.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22
from pandas import Series, Period, PeriodIndex, date_range
33

44

5+
class PeriodProperties(object):
6+
def setup(self):
7+
self.per = Period('2012-06-01', freq='M')
8+
9+
def time_year(self):
10+
self.per.year
11+
12+
def time_month(self):
13+
self.per.month
14+
15+
def time_quarter(self):
16+
self.per.quarter
17+
18+
def time_day(self):
19+
self.per.day
20+
21+
def time_hour(self):
22+
self.per.hour
23+
24+
def time_minute(self):
25+
self.per.second
26+
27+
def time_second(self):
28+
self.per.second
29+
30+
def time_leap_year(self):
31+
self.per.is_leapyear
32+
33+
534
class Constructor(object):
635
goal_time = 0.2
736

asv_bench/benchmarks/rolling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def time_rolling_quantile_median(self):
2626
def time_rolling_median(self):
2727
(self.df.rolling(self.wins).median())
2828

29-
def time_rolling_median(self):
29+
def time_rolling_mean(self):
3030
(self.df.rolling(self.wins).mean())
3131

3232
def time_rolling_max(self):
@@ -68,7 +68,7 @@ def time_rolling_quantile_median_l(self):
6868
def time_rolling_median_l(self):
6969
(self.df.rolling(self.winl).median())
7070

71-
def time_rolling_median_l(self):
71+
def time_rolling_mean_l(self):
7272
(self.df.rolling(self.winl).mean())
7373

7474
def time_rolling_max_l(self):
@@ -118,7 +118,7 @@ def time_rolling_quantile_median(self):
118118
def time_rolling_median(self):
119119
(self.sr.rolling(self.wins).median())
120120

121-
def time_rolling_median(self):
121+
def time_rolling_mean(self):
122122
(self.sr.rolling(self.wins).mean())
123123

124124
def time_rolling_max(self):
@@ -160,7 +160,7 @@ def time_rolling_quantile_median_l(self):
160160
def time_rolling_median_l(self):
161161
(self.sr.rolling(self.winl).median())
162162

163-
def time_rolling_median_l(self):
163+
def time_rolling_mean_l(self):
164164
(self.sr.rolling(self.winl).mean())
165165

166166
def time_rolling_max_l(self):

asv_bench/benchmarks/sparse.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from itertools import repeat
2+
13
from .pandas_vb_common import *
24
import scipy.sparse
35
from pandas import SparseSeries, SparseDataFrame
@@ -27,6 +29,12 @@ class sparse_frame_constructor(object):
2729
def time_sparse_frame_constructor(self):
2830
SparseDataFrame(columns=np.arange(100), index=np.arange(1000))
2931

32+
def time_sparse_from_scipy(self):
33+
SparseDataFrame(scipy.sparse.rand(1000, 1000, 0.005))
34+
35+
def time_sparse_from_dict(self):
36+
SparseDataFrame(dict(zip(range(1000), repeat([0]))))
37+
3038

3139
class sparse_series_from_coo(object):
3240
goal_time = 0.2

0 commit comments

Comments
 (0)