Skip to content

Updates #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
53606ff
BUG: Compat for pre-0.20 TimedeltaIndex and Float64Index pickles #199…
Liam3851 Mar 4, 2018
2fad756
transition period_helper to use pandas_datetimestruct (#19918)
jbrockmendel Mar 4, 2018
607910b
Add month names (#18164)
mroeschke Mar 4, 2018
058a16c
CLN: Use generators in builtin functions (#19989)
mroeschke Mar 5, 2018
cbffd19
fixed pytest deprecation warning (#19987)
bhaveshpoddar94 Mar 5, 2018
aedbd94
TST: text correction, xref #19987
jreback Mar 5, 2018
8a084eb
CLN: deprecate the pandas.tseries.plotting.tsplot function (GH18627) …
GGordonGordon Mar 6, 2018
fe61299
DOC: fixed dynamic import mechanics of make.py (#20005)
WillAyd Mar 6, 2018
6366bf0
TST: clean deprecation warnings for xref #19980 (#20013)
jreback Mar 6, 2018
fd63c90
TST: split series/test_indexing.py (#18614) (#20006)
almaleksia Mar 6, 2018
0038bad
month_name/day_name warnings followup (#20010)
mroeschke Mar 6, 2018
0ca77b3
Datetimelike add/sub catch cases more explicitly, tests (#19912)
jbrockmendel Mar 6, 2018
e02f737
DOC: add doc on ExtensionArray and extending pandas (#19936)
TomAugspurger Mar 6, 2018
db82165
CLN/DOC: cache_readonly: remove allow_setting + preserve docstring (#…
jorisvandenbossche Mar 6, 2018
01b91c2
DOC: is confusing for ddof parameter of sem, var and std functions (#…
alinde1 Mar 6, 2018
56939b4
DOC: misc typos (#20029)
luzpaz Mar 7, 2018
397e296
TST: xfail some tests for mpl 2.2 compat (#20033)
jreback Mar 7, 2018
f6ee9ac
TST: xfail clip tests under numpy-dev (#20035)
jreback Mar 7, 2018
ad15f80
TST: Fix wrong argument in TestDataFrameAlterAxes.test_set_index_dst …
spacesphere Mar 7, 2018
09c416c
DOC: Updated kurt docstring (for pandas sprint) (#19999)
WillAyd Mar 7, 2018
dd2b224
DOC: updating docstring of Index.shift (#19996)
DataOmbudsman Mar 7, 2018
5782ab8
DOC: enable matplotlib plot_directive to include figures in docstring…
jorisvandenbossche Mar 7, 2018
460941f
Fix typos in test_interval_new (#20026)
jschendel Mar 7, 2018
776f2be
Added .pytest_cache to gitignore (#20021)
WillAyd Mar 7, 2018
d14fae8
cleanup ops (#19972)
jbrockmendel Mar 7, 2018
8d462ed
EHN: Implement method argument for DataFrame.replace (#19894)
reidy-p Mar 7, 2018
fd010de
to_sql also accepts Series (#20004)
Mar 7, 2018
2532a49
BUG: Fixes to msgpack support. (#19975)
Liam3851 Mar 7, 2018
f33e84c
Moving tests in series/indexing to fixtures (#20014.1) (#20034)
almaleksia Mar 7, 2018
7c7bd56
enable multivalues insert (#19664)
danfrankj Mar 7, 2018
63ce781
TST: xfail mpl 2.2 tests
jreback Mar 7, 2018
9273bf5
DOC/CI: temp pin matplotlib for doc build (#20045)
jorisvandenbossche Mar 8, 2018
b85f6c1
DOC: update docstring validation script + replace api coverage script…
datapythonista Mar 8, 2018
024d8b4
TST: xfail test_time on py2 & mpl 1.4.3 (#20053)
jreback Mar 8, 2018
b669112
DOC: require returns section in validation script (#19994)
jorisvandenbossche Mar 8, 2018
f9fd540
Added flake8 to DEV requirements (#20063)
WillAyd Mar 9, 2018
1d73cf3
BUG: Dense ranking with percent now uses 100% basis (#15639)
rouzazari Mar 9, 2018
747501a
DOC: Improve docstring for pandas.Index.repeat (#19985)
alysivji Mar 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ scikits
*.c
*.cpp

# Performance Testing #
#######################
# Unit / Performance Testing #
##############################
.pytest_cache/
asv_bench/env/
asv_bench/html/
asv_bench/results/
Expand Down
1 change: 1 addition & 0 deletions ci/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- Cython
- NumPy
- flake8
- moto
- pytest>=3.1
- python-dateutil>=2.5.0
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-3.6_DOC.run
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sphinx
nbconvert
nbformat
notebook
matplotlib
matplotlib=2.1*
seaborn
scipy
lxml
Expand Down
3 changes: 2 additions & 1 deletion ci/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Do not modify directly
Cython
NumPy
flake8
moto
pytest>=3.1
python-dateutil>=2.5.0
pytz
setuptools>=3.3
sphinx
sphinx
13 changes: 9 additions & 4 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$ python make.py html
$ python make.py latex
"""
import importlib
import sys
import os
import shutil
Expand All @@ -20,8 +21,6 @@
import webbrowser
import jinja2

import pandas


DOC_PATH = os.path.dirname(os.path.abspath(__file__))
SOURCE_PATH = os.path.join(DOC_PATH, 'source')
Expand Down Expand Up @@ -134,7 +133,7 @@ def _process_single_doc(self, single_doc):
self.single_doc = single_doc
elif single_doc is not None:
try:
obj = pandas
obj = pandas # noqa: F821
for name in single_doc.split('.'):
obj = getattr(obj, name)
except AttributeError:
Expand Down Expand Up @@ -332,7 +331,7 @@ def main():
'compile, e.g. "indexing", "DataFrame.join"'))
argparser.add_argument('--python-path',
type=str,
default=os.path.join(DOC_PATH, '..'),
default=os.path.dirname(DOC_PATH),
help='path')
argparser.add_argument('-v', action='count', dest='verbosity', default=0,
help=('increase verbosity (can be repeated), '
Expand All @@ -343,7 +342,13 @@ def main():
raise ValueError('Unknown command {}. Available options: {}'.format(
args.command, ', '.join(cmds)))

# Below we update both os.environ and sys.path. The former is used by
# external libraries (namely Sphinx) to compile this module and resolve
# the import of `python_path` correctly. The latter is used to resolve
# the import within the module, injecting it into the global namespace
os.environ['PYTHONPATH'] = args.python_path
sys.path.append(args.python_path)
globals()['pandas'] = importlib.import_module('pandas')

builder = DocBuilder(args.num_jobs, not args.no_api, args.single,
args.verbosity)
Expand Down
9 changes: 6 additions & 3 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ These can be accessed like ``Series.dt.<property>``.
Series.dt.weekofyear
Series.dt.dayofweek
Series.dt.weekday
Series.dt.weekday_name
Series.dt.dayofyear
Series.dt.quarter
Series.dt.is_month_start
Expand Down Expand Up @@ -581,6 +580,8 @@ These can be accessed like ``Series.dt.<property>``.
Series.dt.round
Series.dt.floor
Series.dt.ceil
Series.dt.month_name
Series.dt.day_name

**Timedelta Properties**

Expand Down Expand Up @@ -1723,7 +1724,6 @@ Time/Date Components
DatetimeIndex.week
DatetimeIndex.dayofweek
DatetimeIndex.weekday
DatetimeIndex.weekday_name
DatetimeIndex.quarter
DatetimeIndex.tz
DatetimeIndex.freq
Expand Down Expand Up @@ -1759,6 +1759,8 @@ Time-specific operations
DatetimeIndex.round
DatetimeIndex.floor
DatetimeIndex.ceil
DatetimeIndex.month_name
DatetimeIndex.day_name

Conversion
~~~~~~~~~~
Expand Down Expand Up @@ -1940,7 +1942,6 @@ Properties
Timestamp.tzinfo
Timestamp.value
Timestamp.week
Timestamp.weekday_name
Timestamp.weekofyear
Timestamp.year

Expand All @@ -1954,6 +1955,7 @@ Methods
Timestamp.combine
Timestamp.ctime
Timestamp.date
Timestamp.day_name
Timestamp.dst
Timestamp.floor
Timestamp.freq
Expand All @@ -1963,6 +1965,7 @@ Methods
Timestamp.isocalendar
Timestamp.isoformat
Timestamp.isoweekday
Timestamp.month_name
Timestamp.normalize
Timestamp.now
Timestamp.replace
Expand Down
2 changes: 1 addition & 1 deletion doc/source/categorical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ are consistent among all columns.
.. note::

To perform table-wise conversion, where all labels in the entire ``DataFrame`` are used as
categories for each column, the ``categories`` parameter can be determined programatically by
categories for each column, the ``categories`` parameter can be determined programmatically by
``categories = pd.unique(df.values.ravel())``.

If you already have ``codes`` and ``categories``, you can use the
Expand Down
9 changes: 9 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
'ipython_sphinxext.ipython_console_highlighting',
# lowercase didn't work
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
Expand All @@ -85,6 +86,14 @@
if any(re.match("\s*api\s*", l) for l in index_rst_lines):
autosummary_generate = True

# matplotlib plot directive
plot_include_source = True
plot_formats = [("png", 90)]
plot_html_show_formats = False
plot_html_show_source_link = False
plot_pre_code = """import numpy as np
import pandas as pd"""

# Add any paths that contain templates here, relative to this directory.
templates_path = ['../_templates']

Expand Down
6 changes: 4 additions & 2 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ Some other important things to know about the docs:

pandoc doc/source/contributing.rst -t markdown_github > CONTRIBUTING.md

The utility script ``scripts/api_rst_coverage.py`` can be used to compare
the list of methods documented in ``doc/source/api.rst`` (which is used to generate
The utility script ``scripts/validate_docstrings.py`` can be used to get a csv
summary of the API documentation. And also validate common errors in the docstring
of a specific class, function or method. The summary also compares the list of
methods documented in ``doc/source/api.rst`` (which is used to generate
the `API Reference <http://pandas.pydata.org/pandas-docs/stable/api.html>`_ page)
and the actual public methods.
This will identify methods documented in ``doc/source/api.rst`` that are not actually
Expand Down
43 changes: 0 additions & 43 deletions doc/source/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,46 +140,3 @@ As an example of fully-formed metadata:
'metadata': None}
],
'pandas_version': '0.20.0'}

.. _developer.register-accessors:

Registering Custom Accessors
----------------------------

Libraries can use the decorators
:func:`pandas.api.extensions.register_dataframe_accessor`,
:func:`pandas.api.extensions.register_series_accessor`, and
:func:`pandas.api.extensions.register_index_accessor`, to add additional "namespaces" to
pandas objects. All of these follow a similar convention: you decorate a class, providing the name of attribute to add. The
class's `__init__` method gets the object being decorated. For example:

.. code-block:: python

@pd.api.extensions.register_dataframe_accessor("geo")
class GeoAccessor(object):
def __init__(self, pandas_obj):
self._obj = pandas_obj

@property
def center(self):
# return the geographic center point of this DataFarme
lon = self._obj.latitude
lat = self._obj.longitude
return (float(lon.mean()), float(lat.mean()))

def plot(self):
# plot this array's data on a map, e.g., using Cartopy
pass

Now users can access your methods using the `geo` namespace:

>>> ds = pd.DataFrame({'longitude': np.linspace(0, 10),
... 'latitude': np.linspace(0, 20)})
>>> ds.geo.center
(5.0, 10.0)
>>> ds.geo.plot()
# plots data on a map

This can be a convenient way to extend pandas objects without subclassing them.
If you write a custom accessor, make a pull request adding it to our
:ref:`ecosystem` page.
35 changes: 35 additions & 0 deletions doc/source/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,38 @@ Data validation

Engarde is a lightweight library used to explicitly state your assumptions abour your datasets
and check that they're *actually* true.

.. _ecosystem.extensions:

Extension Data Types
--------------------

Pandas provides an interface for defining
:ref:`extension types <extending.extension-types>` to extend NumPy's type
system. The following libraries implement that interface to provide types not
found in NumPy or pandas, which work well with pandas' data containers.

`cyberpandas`_
~~~~~~~~~~~~~~

Cyberpandas provides an extension type for storing arrays of IP Addresses. These
arrays can be stored inside pandas' Series and DataFrame.

.. _ecosystem.accessors:

Accessors
---------

A directory of projects providing
:ref:`extension accessors <extending.register-accessors>`. This is for users to
discover new accessors and for library authors to coordinate on the namespace.

============== ========== =========================
Library Accessor Classes
============== ========== =========================
`cyberpandas`_ ``ip`` ``Series``
`pdvega`_ ``vgplot`` ``Series``, ``DataFrame``
============== ========== =========================

.. _cyberpandas: https://cyberpandas.readthedocs.io/en/latest
.. _pdvega: https://jakevdp.github.io/pdvega/
Loading