Skip to content

Commit f2ed8c3

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into Series.searchsorted_api
2 parents 4b31c78 + 2b5058e commit f2ed8c3

Some content is hidden

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

57 files changed

+612
-653
lines changed

.github/CONTRIBUTING.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
Contributing to pandas
2-
======================
1+
# Contributing to pandas
32

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

6-
Our main contribution docs can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst), but 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 places in the docs for further information.
5+
Our main contributing guide can be found [in this repo](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst) or [on the website](https://pandas-docs.github.io/pandas-docs-travis/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.
6+
7+
## Getting Started
78

8-
Getting Started
9-
---------------
109
If you are looking to contribute to the *pandas* codebase, the best place to start is the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues). This is also a great place for filing bug reports and making suggestions for ways in which we can improve the code and documentation.
1110

12-
If you have additional questions, feel free to ask them on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas). Further information can also be found in our [Getting Started](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#where-to-start) section of our main contribution doc.
11+
If you have additional questions, feel free to ask them on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas). Further information can also be found in the "[Where to start?](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#where-to-start)" section.
12+
13+
## Filing Issues
14+
15+
If you notice a bug in the code or documentation, or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) using [GitHub's "issue" form](https://github.com/pandas-dev/pandas/issues/new). The form contains some questions that will help us best address your issue. For more information regarding how to file issues against *pandas*, please refer to the "[Bug reports and enhancement requests](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#bug-reports-and-enhancement-requests)" section.
1316

14-
Filing Issues
15-
-------------
16-
If you notice a bug in the code or in docs or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) using [GitHub's "issue" form](https://github.com/pandas-dev/pandas/issues/new). The form contains some questions that will help us best address your issue. For more information regarding how to file issues against *pandas*, please refer to the [Bug reports and enhancement requests](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#bug-reports-and-enhancement-requests) section of our main contribution doc.
17+
## Contributing to the Codebase
1718

18-
Contributing to the Codebase
19-
----------------------------
20-
The code is hosted on [GitHub](https://www.github.com/pandas-dev/pandas), so you will need to use [Git](http://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment. For more information, please refer to our [Working with the code](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#working-with-the-code) section of our main contribution docs.
19+
The code is hosted on [GitHub](https://www.github.com/pandas-dev/pandas), so you will need to use [Git](http://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment. For more information, please refer to the "[Working with the code](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#working-with-the-code)" section.
2120

22-
Before submitting your changes for review, make sure to check that your changes do not break any tests. You can find more information about our test suites can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#test-driven-development-code-writing). We also have guidelines regarding coding style that will be enforced during testing. Details about coding style can be found [here](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#code-standards).
21+
Before submitting your changes for review, make sure to check that your changes do not break any tests. You can find more information about our test suites in the "[Test-driven development/code writing](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#test-driven-development-code-writing)" section. We also have guidelines regarding coding style that will be enforced during testing, which can be found in the "[Code standards](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#code-standards)" section.
2322

24-
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. Details about how to do that can be found in the [Contributing your changes to pandas](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#contributing-your-changes-to-pandas) section of our main contribution docs. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!
23+
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. Details about how to do that can be found in the "[Contributing your changes to pandas](https://github.com/pandas-dev/pandas/blob/master/doc/source/contributing.rst#contributing-your-changes-to-pandas)" section. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ Most development discussion is taking place on github in this repo. Further, the
231231

232232
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
233233

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

236-
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.
236+
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.
237237

238238
You can also triage issues which may include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
239239

ci/build_docs.sh

+27-22
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,33 @@ if [ "$DOC" ]; then
2525
echo # Create and send docs #
2626
echo ########################
2727

28-
cd build/html
29-
git config --global user.email "[email protected]"
30-
git config --global user.name "pandas-docs-bot"
31-
32-
# create the repo
33-
git init
34-
35-
touch README
36-
git add README
37-
git commit -m "Initial commit" --allow-empty
38-
git branch gh-pages
39-
git checkout gh-pages
40-
touch .nojekyll
41-
git add --all .
42-
git commit -m "Version" --allow-empty
43-
44-
git remote remove origin
45-
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
46-
git fetch origin
47-
git remote -v
48-
49-
git push origin gh-pages -f
28+
echo "Only uploading docs when TRAVIS_PULL_REQUEST is 'false'"
29+
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
30+
31+
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
32+
cd build/html
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "pandas-docs-bot"
35+
36+
# create the repo
37+
git init
38+
39+
touch README
40+
git add README
41+
git commit -m "Initial commit" --allow-empty
42+
git branch gh-pages
43+
git checkout gh-pages
44+
touch .nojekyll
45+
git add --all .
46+
git commit -m "Version" --allow-empty
47+
48+
git remote remove origin
49+
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
50+
git fetch origin
51+
git remote -v
52+
53+
git push origin gh-pages -f
54+
fi
5055
fi
5156

5257
exit 0

doc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See `contributing.rst <https://pandas.pydata.org/pandas-docs/stable/contributing.html>`_ in this repo.
1+
See `contributing.rst <https://pandas-docs.github.io/pandas-docs-travis/contributing.html>`_ in this repo.

doc/source/api.rst

+20-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ HDFStore: PyTables (HDF5)
113113
HDFStore.select
114114
HDFStore.info
115115
HDFStore.keys
116+
HDFStore.groups
116117
HDFStore.walk
117118

118119
Feather
@@ -611,6 +612,16 @@ These can be accessed like ``Series.dt.<property>``.
611612
Series.dt.month_name
612613
Series.dt.day_name
613614

615+
**Period Properties**
616+
617+
.. autosummary::
618+
:toctree: generated/
619+
:template: autosummary/accessor_attribute.rst
620+
621+
Series.dt.qyear
622+
Series.dt.start_time
623+
Series.dt.end_time
624+
614625
**Timedelta Properties**
615626

616627
.. autosummary::
@@ -1648,7 +1659,14 @@ Categorical Components
16481659
CategoricalIndex.set_categories
16491660
CategoricalIndex.as_ordered
16501661
CategoricalIndex.as_unordered
1662+
1663+
Modifying and Computations
1664+
~~~~~~~~~~~~~~~~~~~~~~~~~~
1665+
.. autosummary::
1666+
:toctree: generated/
1667+
16511668
CategoricalIndex.map
1669+
CategoricalIndex.equals
16521670

16531671
.. _api.intervalindex:
16541672

@@ -1741,7 +1759,6 @@ MultiIndex Components
17411759
MultiIndex.swaplevel
17421760
MultiIndex.reorder_levels
17431761
MultiIndex.remove_unused_levels
1744-
MultiIndex.unique
17451762

17461763
MultiIndex Selecting
17471764
~~~~~~~~~~~~~~~~~~~~
@@ -1750,6 +1767,7 @@ MultiIndex Selecting
17501767
:toctree: generated/
17511768

17521769
MultiIndex.get_loc
1770+
MultiIndex.get_loc_level
17531771
MultiIndex.get_indexer
17541772
MultiIndex.get_level_values
17551773

@@ -2292,6 +2310,7 @@ Function application
22922310
:toctree: generated/
22932311

22942312
GroupBy.apply
2313+
GroupBy.agg
22952314
GroupBy.aggregate
22962315
GroupBy.transform
22972316
GroupBy.pipe
@@ -2336,7 +2355,6 @@ application to columns of a specific data type.
23362355
.. autosummary::
23372356
:toctree: generated/
23382357

2339-
DataFrameGroupBy.agg
23402358
DataFrameGroupBy.all
23412359
DataFrameGroupBy.any
23422360
DataFrameGroupBy.bfill

doc/source/basics.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ may involve copying data and coercing values.
8888

8989
Getting the "raw data" inside a :class:`DataFrame` is possibly a bit more
9090
complex. When your ``DataFrame`` only has a single data type for all the
91-
columns, :atr:`DataFrame.to_numpy` will return the underlying data:
91+
columns, :attr:`DataFrame.to_numpy` will return the underlying data:
9292

9393
.. ipython:: python
9494
@@ -1931,7 +1931,7 @@ Categorical :class:`CategoricalDtype` (none) :class:`Categor
19311931
period (time spans) :class:`PeriodDtype` :class:`Period` :class:`arrays.PeriodArray` :ref:`timeseries.periods`
19321932
sparse :class:`SparseDtype` (none) :class:`arrays.SparseArray` :ref:`sparse`
19331933
intervals :class:`IntervalDtype` :class:`Interval` :class:`arrays.IntervalArray` :ref:`advanced.intervalindex`
1934-
nullable integer :clsas:`Int64Dtype`, ... (none) :class:`arrays.IntegerArray` :ref:`integer_na`
1934+
nullable integer :class:`Int64Dtype`, ... (none) :class:`arrays.IntegerArray` :ref:`integer_na`
19351935
=================== ========================= ================== ============================= =============================
19361936

19371937
Pandas uses the ``object`` dtype for storing strings.
@@ -2324,4 +2324,4 @@ All NumPy dtypes are subclasses of ``numpy.generic``:
23242324
.. note::
23252325

23262326
Pandas also defines the types ``category``, and ``datetime64[ns, tz]``, which are not integrated into the normal
2327-
NumPy hierarchy and won't show up with the above function.
2327+
NumPy hierarchy and won't show up with the above function.

doc/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369

370370
intersphinx_mapping = {
371371
'statsmodels': ('http://www.statsmodels.org/devel/', None),
372-
'matplotlib': ('http://matplotlib.org/', None),
372+
'matplotlib': ('https://matplotlib.org/', None),
373373
'pandas-gbq': ('https://pandas-gbq.readthedocs.io/en/latest/', None),
374374
'python': ('https://docs.python.org/3/', None),
375375
'numpy': ('https://docs.scipy.org/doc/numpy/', None),

doc/source/ecosystem.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ which are utilized by Jupyter Notebook for displaying
142142
(Note: HTML tables may or may not be
143143
compatible with non-HTML Jupyter output formats.)
144144

145-
See :ref:`Options and Settings <options>` and :ref:`options.available`
145+
See :ref:`Options and Settings <options>` and :ref:`<options.available>`
146146
for pandas ``display.`` settings.
147147

148148
`quantopian/qgrid <https://github.com/quantopian/qgrid>`__

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ methods described above.
193193
Installing from source
194194
~~~~~~~~~~~~~~~~~~~~~~
195195

196-
See the :ref:`contributing documentation <contributing>` for complete instructions on building from the git source tree. Further, see :ref:`creating a development environment <contributing.dev_env>` if you wish to create a *pandas* development environment.
196+
See the :ref:`contributing guide <contributing>` for complete instructions on building from the git source tree. Further, see :ref:`creating a development environment <contributing.dev_env>` if you wish to create a *pandas* development environment.
197197

198198
Running the test suite
199199
----------------------

doc/source/io.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,9 @@ Writing to a file, with a date index and a date column:
18631863
dfj2['bools'] = True
18641864
dfj2.index = pd.date_range('20130101', periods=5)
18651865
dfj2.to_json('test.json')
1866-
open('test.json').read()
1866+
1867+
with open('test.json') as fh:
1868+
print(fh.read())
18671869
18681870
Fallback Behavior
18691871
+++++++++++++++++
@@ -2321,6 +2323,11 @@ indicate missing values and the subsequent read cannot distinguish the intent.
23212323
new_df = pd.read_json('test.json', orient='table')
23222324
print(new_df.index.name)
23232325
2326+
.. ipython:: python
2327+
:suppress:
2328+
2329+
os.remove('test.json')
2330+
23242331
.. _Table Schema: https://specs.frictionlessdata.io/json-table-schema/
23252332

23262333
HTML
@@ -4766,6 +4773,11 @@ this file into a ``DataFrame``.
47664773
Passing ``index=True`` will *always* write the index, even if that's not the
47674774
underlying engine's default behavior.
47684775

4776+
.. ipython:: python
4777+
:suppress:
4778+
4779+
os.remove('test.parquet')
4780+
47694781
47704782
Partitioning Parquet files
47714783
''''''''''''''''''''''''''

doc/source/overview.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ pandas is actively supported today by a community of like-minded individuals aro
9191
the world who contribute their valuable time and energy to help make open source
9292
pandas possible. Thanks to `all of our contributors <https://github.com/pandas-dev/pandas/graphs/contributors>`__.
9393

94-
If you're interested in contributing, please
95-
visit `Contributing to pandas webpage <https://pandas.pydata.org/pandas-docs/stable/contributing.html>`__.
94+
If you're interested in contributing, please visit the :ref:`contributing guide <contributing>`.
9695

9796
pandas is a `NumFOCUS <https://www.numfocus.org/open-source-projects/>`__ sponsored project.
9897
This will help ensure the success of development of pandas as a world-class open-source

doc/source/timeseries.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ in the usual way.
10841084
dt + bmth_us
10851085
10861086
# Define date index with custom offset
1087-
pd.DatetimeIndex(start='20100101', end='20120101', freq=bmth_us)
1087+
pd.date_range(start='20100101', end='20120101', freq=bmth_us)
10881088
10891089
.. note::
10901090

@@ -1438,8 +1438,8 @@ or ``Timestamp`` objects.
14381438

14391439
.. ipython:: python
14401440
1441-
pd.DatetimeIndex(start='7/1/2012', end='7/10/2012',
1442-
freq=pd.offsets.CDay(calendar=cal)).to_pydatetime()
1441+
pd.date_range(start='7/1/2012', end='7/10/2012',
1442+
freq=pd.offsets.CDay(calendar=cal)).to_pydatetime()
14431443
offset = pd.offsets.CustomBusinessDay(calendar=cal)
14441444
datetime.datetime(2012, 5, 25) + offset
14451445
datetime.datetime(2012, 7, 3) + offset
@@ -2300,8 +2300,8 @@ To remove timezone from tz-aware ``DatetimeIndex``, use ``tz_localize(None)`` or
23002300

23012301
.. ipython:: python
23022302
2303-
didx = pd.DatetimeIndex(start='2014-08-01 09:00', freq='H',
2304-
periods=10, tz='US/Eastern')
2303+
didx = pd.date_range(start='2014-08-01 09:00', freq='H',
2304+
periods=10, tz='US/Eastern')
23052305
didx
23062306
didx.tz_localize(None)
23072307
didx.tz_convert(None)
@@ -2354,8 +2354,8 @@ constructor as well as ``tz_localize``.
23542354
rng_hourly.tz_localize('US/Eastern', ambiguous=rng_hourly_dst).to_list()
23552355
rng_hourly.tz_localize('US/Eastern', ambiguous='NaT').to_list()
23562356
2357-
didx = pd.DatetimeIndex(start='2014-08-01 09:00', freq='H',
2358-
periods=10, tz='US/Eastern')
2357+
didx = pd.date_range(start='2014-08-01 09:00', freq='H',
2358+
periods=10, tz='US/Eastern')
23592359
didx
23602360
didx.tz_localize(None)
23612361
didx.tz_convert(None)

doc/source/tutorials.rst

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ Video Tutorials
8686
* `Pandas: .head() to .tail() <https://www.youtube.com/watch?v=7vuO9QXDN50>`_
8787
(2016) (1:26)
8888
`GitHub repo <https://github.com/TomAugspurger/pydata-chi-h2t>`__
89+
* `Data analysis in Python with pandas <https://www.youtube.com/playlist?list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y>`_
90+
(2016-2018)
91+
`GitHub repo <https://github.com/justmarkham/pandas-videos>`_ and
92+
`Jupyter Notebook <http://nbviewer.jupyter.org/github/justmarkham/pandas-videos/blob/master/pandas.ipynb>`_
93+
* `Best practices with pandas <https://www.youtube.com/playlist?list=PL5-da3qGB5IBITZj_dYSFqnd_15JgqwA6>`_
94+
(2018)
95+
`GitHub repo <https://github.com/justmarkham/pycon-2018-tutorial>`_ and
96+
`Jupyter Notebook <http://nbviewer.jupyter.org/github/justmarkham/pycon-2018-tutorial/blob/master/tutorial.ipynb>`_
8997

9098

9199
Various Tutorials

0 commit comments

Comments
 (0)