-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR: deprecate some top-level non-used functions #15538
Conversation
@jreback Thanks for the PR! For me, the main question is, do we actually need those functions? If not, I don't think we have to recommend an alternative import path, but just say they are "deprecated and will be removed in a future version"
|
didn't realize this, yes I will point that out as instead (and deprecate Period.pnow() as well)
This is barely tested, not documented, and AFAICT never used anywhere. So it might have utility, but certainly not as a top-level function. |
da53aac
to
7c52dd3
Compare
Codecov Report
@@ Coverage Diff @@
## master #15538 +/- ##
==========================================
- Coverage 91.04% 91.02% -0.02%
==========================================
Files 136 136
Lines 49088 49107 +19
==========================================
+ Hits 44694 44702 +8
- Misses 4394 4405 +11
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
I personally wouldn't even mention the alternative path for match
, if you say that it is "barely tested, not documented, and AFAICT never used anywhere", we shouldn't encourage it.
If someone uses it, sees the removal message, they can always complain that it was useful and we can think about how to publicly expose it (I don't think core.algorithms
should be that place).
doc/source/whatsnew/v0.20.0.txt
Outdated
@@ -534,6 +534,12 @@ Deprecations | |||
- ``Series.sortlevel`` and ``DataFrame.sortlevel`` have been deprecated in favor of ``Series.sort_index`` and ``DataFrame.sort_index`` (:issue:`15099`) | |||
- importing ``concat`` from ``pandas.tools.merge`` has been deprecated in favor of imports from the ``pandas`` namespace. This should only affect explict imports (:issue:`15358`) | |||
- ``Series/DataFrame/Panel.consolidate()`` been deprecated as a public method. (:issue:`15483`) | |||
- The following top-level pandas functions have been deprecated and will be removed in a future version (:issue:`13790`) | |||
* ``pd.now()``, replaced by a direct import from ``pandas.tseries.period`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have to refer to tseries.period
, but just remove it altogether? (or at least not recommend it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually you also have pd.Period.now(freq='H')
pandas/io/api.py
Outdated
|
||
warnings.warn("pd.Term is deprecated as it is not " | ||
"applicable to user code. Instead use in-line " | ||
"string expressions in for searching HDFStore", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this sentence also to the whatsnew overview?
pandas - a powerful data analysis and manipulation library for Python | ||
===================================================================== | ||
|
||
See http://pandas.pydata.org/ for full documentation. Otherwise, see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to remove this file. To have the same effect (people doing pd?
see some info), you can put eg what is above this comment in __init__.py
as module docstring. It's not that useful, but it does also no harm to have a minimal explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could theorectically replace this with something (maybe a minimal README type of thing, so its on the actual doc-string). any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah should replace with something, maybe a pointer to the docs (plus some minmal stuff). I can simply define this directly I think (in init.py). Any thoughts on what this should say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can just put the exact same string on the first lines of __init__.py
, and it will be interpreted as the module docstring.
I would put just the same as here (title, and link to full docs). In principle we could do some clever parsing of a README file and adding that, but I wouldn't do that effort personally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did this
In [1]: pd?
Type: module
String form: <module 'pandas' from '/Users/jreback/pandas/pandas/__init__.py'>
File: ~/pandas/pandas/__init__.py
Docstring:
pandas - a powerful data analysis and manipulation library for Python
=====================================================================
**pandas** is a Python package providing fast, flexible, and expressive data
structures designed to make working with "relational" or "labeled" data both
easy and intuitive. It aims to be the fundamental high-level building block for
doing practical, **real world** data analysis in Python. Additionally, it has
the broader goal of becoming **the most powerful and flexible open source data
analysis / manipulation tool available in any language**. It is already well on
its way toward this goal.
Main Features
-------------
Here are just a few of the things that pandas does well:
- Easy handling of missing data in floating point as well as
non-floating point data
- Size mutability: columns can be inserted and deleted from
DataFrame and higher dimensional objects
- Automatic and explicit data alignment: objects can be
explicitly aligned to a set of labels, or the user can simply
ignore the labels and let `Series`, `DataFrame`, etc. automatically
align the data for you in computations
- Powerful, flexible group by functionality to perform
split-apply-combine operations on data sets, for both aggregating
and transforming data
- Make it easy to convert ragged, differently-indexed data in
other Python and NumPy data structures into DataFrame objects
- Intelligent label-based slicing, fancy indexing, and subsetting of
large data sets
- Intuitive merging and joining data sets
- Flexible reshaping and pivoting of data sets
- Hierarchical labeling of axes (possible to have multiple
labels per tick)
- Robust IO tools for loading data from flat files
(CSV and delimited), Excel files, databases,
and saving/loading data from the ultrafast HDF5 format
- Time series-specific functionality: date range
generation and frequency conversion, moving window statistics,
moving window linear regressions, date shifting and lagging, etc.
as the README.md has all kinds of html and such (and is too long)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
closes pandas-dev#13790 pd.pnow pd.groupby pd.match pd.Term pd.Expr remove info.py
so we have this mini example in http://pandas-docs.github.io/pandas-docs-travis/comparison_with_r.html
which is actually confusing / misleading.
is much more useful (I don't know why you would want that kind of transformation) though I don't use R much, so not sure what it is trying to show. |
Hmm, I would maybe just remove that example ( |
@jorisvandenbossche yep sounds good. Yeah the function still exists, its just not top-level (like These made much more sense when directly allowing numpy arrays was useful (but that is less and less useful). But this is another story. ok will remove that part of the doc. |
closes pandas-dev#13790 pd.pnow pd.groupby pd.match pd.Term pd.Expr remove info.py
Drops the following: * pd.pnow * pd.match * pd.groupby * pd.get_store * pd.Expr * pd.Term xref pandas-devgh-15538. xref pandas-devgh-15940.
Drops the following: * pd.pnow * pd.match * pd.groupby * pd.get_store * pd.Expr * pd.Term xref pandas-devgh-15538. xref pandas-devgh-15940.
Drops the following: * pd.pnow * pd.match * pd.groupby * pd.get_store * pd.Expr * pd.Term xref pandas-devgh-15538. xref pandas-devgh-15940.
Drops the following: * pd.pnow * pd.match * pd.groupby * pd.get_store * pd.Expr * pd.Term xref pandas-devgh-15538. xref pandas-devgh-15940.
closes #13790
remove info.py