Skip to content

Commit e5c1420

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bug/categorical-indexing-1row-df
* upstream/master: (32 commits) DEPR: Series.cat.categorical (pandas-dev#29914) DEPR: infer_dtype default for skipna is now True (pandas-dev#29876) Fix broken asv (pandas-dev#29906) DEPR: Remove weekday_name (pandas-dev#29831) Fix mypy errors for pandas\tests\series\test_operators.py (pandas-dev#29826) CI: Setting path only once in GitHub Actions (pandas-dev#29867) DEPR: passing td64 data to DTA or dt64 data to TDA (pandas-dev#29794) CLN: remove unsupported sparse code from io.pytables (pandas-dev#29863) x.__class__ TO type(x) (pandas-dev#29889) DEPR: ftype, ftypes (pandas-dev#29895) REF: use named funcs instead of lambdas (pandas-dev#29841) Correct type inference for UInt64Index during access (pandas-dev#29420) CLN: follow-up to 29725 (pandas-dev#29890) CLN: trim unnecessary code in indexing tests (pandas-dev#29845) TST added test for groupby agg on mulitlevel column (pandas-dev#29772) (pandas-dev#29866) mypy fix (pandas-dev#29891) Typing annotations (pandas-dev#29850) Fix mypy error in pandas/tests.indexes.test_base.py (pandas-dev#29188) CLN: remove never-used kwargs, make kwargs explicit (pandas-dev#29873) TYP: Added typing to __eq__ functions (pandas-dev#29818) ...
2 parents 2b71592 + ea2e26a commit e5c1420

File tree

88 files changed

+463
-1053
lines changed

Some content is hidden

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

88 files changed

+463
-1053
lines changed

.github/workflows/ci.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88

99
env:
1010
ENV_FILE: environment.yml
11-
# TODO: remove export PATH=... in each step once this works
12-
# PATH: $HOME/miniconda3/bin:$PATH
1311

1412
jobs:
1513
checks:
@@ -20,68 +18,61 @@ jobs:
2018
- name: Checkout
2119
uses: actions/checkout@v1
2220

21+
- name: Setting conda path
22+
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"
23+
2324
- name: Looking for unwanted patterns
2425
run: ci/code_checks.sh patterns
2526
if: true
2627

2728
- name: Setup environment and build pandas
28-
run: |
29-
export PATH=$HOME/miniconda3/bin:$PATH
30-
ci/setup_env.sh
29+
run: ci/setup_env.sh
3130
if: true
3231

3332
- name: Linting
3433
run: |
35-
export PATH=$HOME/miniconda3/bin:$PATH
3634
source activate pandas-dev
3735
ci/code_checks.sh lint
3836
if: true
3937

4038
- name: Dependencies consistency
4139
run: |
42-
export PATH=$HOME/miniconda3/bin:$PATH
4340
source activate pandas-dev
4441
ci/code_checks.sh dependencies
4542
if: true
4643

4744
- name: Checks on imported code
4845
run: |
49-
export PATH=$HOME/miniconda3/bin:$PATH
5046
source activate pandas-dev
5147
ci/code_checks.sh code
5248
if: true
5349

5450
- name: Running doctests
5551
run: |
56-
export PATH=$HOME/miniconda3/bin:$PATH
5752
source activate pandas-dev
5853
ci/code_checks.sh doctests
5954
if: true
6055

6156
- name: Docstring validation
6257
run: |
63-
export PATH=$HOME/miniconda3/bin:$PATH
6458
source activate pandas-dev
6559
ci/code_checks.sh docstrings
6660
if: true
6761

6862
- name: Typing validation
6963
run: |
70-
export PATH=$HOME/miniconda3/bin:$PATH
7164
source activate pandas-dev
7265
ci/code_checks.sh typing
7366
if: true
7467

7568
- name: Testing docstring validation script
7669
run: |
77-
export PATH=$HOME/miniconda3/bin:$PATH
7870
source activate pandas-dev
7971
pytest --capture=no --strict scripts
8072
if: true
8173

8274
- name: Running benchmarks
8375
run: |
84-
export PATH=$HOME/miniconda3/bin:$PATH
8576
source activate pandas-dev
8677
cd asv_bench
8778
asv check -E existing

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,11 @@ pip install pandas
164164
```
165165

166166
## Dependencies
167-
- [NumPy](https://www.numpy.org): 1.13.3 or higher
168-
- [python-dateutil](https://labix.org/python-dateutil): 2.5.0 or higher
169-
- [pytz](https://pythonhosted.org/pytz): 2015.4 or higher
167+
- [NumPy](https://www.numpy.org)
168+
- [python-dateutil](https://labix.org/python-dateutil)
169+
- [pytz](https://pythonhosted.org/pytz)
170170

171-
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
172-
for recommended and optional dependencies.
171+
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
173172

174173
## Installation from sources
175174
To install pandas from source you need Cython in addition to the normal

asv_bench/benchmarks/timeseries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class InferFreq:
113113
def setup(self, freq):
114114
if freq is None:
115115
self.idx = date_range(start="1/1/1700", freq="D", periods=10000)
116-
self.idx.freq = None
116+
self.idx._data._freq = None
117117
else:
118118
self.idx = date_range(start="1/1/1700", freq=freq, periods=10000)
119119

azure-pipelines.yml

-89
Original file line numberDiff line numberDiff line change
@@ -16,95 +16,6 @@ jobs:
1616
name: Windows
1717
vmImage: vs2017-win2016
1818

19-
- job: 'Checks'
20-
pool:
21-
vmImage: ubuntu-16.04
22-
timeoutInMinutes: 90
23-
steps:
24-
- script: |
25-
echo '##vso[task.prependpath]$(HOME)/miniconda3/bin'
26-
echo '##vso[task.setvariable variable=ENV_FILE]environment.yml'
27-
echo '##vso[task.setvariable variable=AZURE]true'
28-
displayName: 'Setting environment variables'
29-
30-
# Do not require a conda environment
31-
- script: ci/code_checks.sh patterns
32-
displayName: 'Looking for unwanted patterns'
33-
condition: true
34-
35-
- script: |
36-
sudo apt-get update
37-
sudo apt-get install -y libc6-dev-i386
38-
ci/setup_env.sh
39-
displayName: 'Setup environment and build pandas'
40-
condition: true
41-
42-
# Do not require pandas
43-
- script: |
44-
source activate pandas-dev
45-
ci/code_checks.sh lint
46-
displayName: 'Linting'
47-
condition: true
48-
49-
- script: |
50-
source activate pandas-dev
51-
ci/code_checks.sh dependencies
52-
displayName: 'Dependencies consistency'
53-
condition: true
54-
55-
# Require pandas
56-
- script: |
57-
source activate pandas-dev
58-
ci/code_checks.sh code
59-
displayName: 'Checks on imported code'
60-
condition: true
61-
62-
- script: |
63-
source activate pandas-dev
64-
ci/code_checks.sh doctests
65-
displayName: 'Running doctests'
66-
condition: true
67-
68-
- script: |
69-
source activate pandas-dev
70-
ci/code_checks.sh docstrings
71-
displayName: 'Docstring validation'
72-
condition: true
73-
74-
- script: |
75-
source activate pandas-dev
76-
ci/code_checks.sh typing
77-
displayName: 'Typing validation'
78-
condition: true
79-
80-
- script: |
81-
source activate pandas-dev
82-
pytest --capture=no --strict scripts
83-
displayName: 'Testing docstring validation script'
84-
condition: true
85-
86-
- script: |
87-
source activate pandas-dev
88-
cd asv_bench
89-
asv check -E existing
90-
git remote add upstream https://github.com/pandas-dev/pandas.git
91-
git fetch upstream
92-
if git diff upstream/master --name-only | grep -q "^asv_bench/"; then
93-
asv machine --yes
94-
ASV_OUTPUT="$(asv dev)"
95-
if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then
96-
echo "##vso[task.logissue type=error]Benchmarks run with errors"
97-
echo "$ASV_OUTPUT"
98-
exit 1
99-
else
100-
echo "Benchmarks run without errors"
101-
fi
102-
else
103-
echo "Benchmarks did not run, no changes detected"
104-
fi
105-
displayName: 'Running benchmarks'
106-
condition: true
107-
10819
- job: 'Web_and_Docs'
10920
pool:
11021
vmImage: ubuntu-16.04

doc/redirects.csv

-7
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,8 @@ generated/pandas.DataFrame.from_csv,../reference/api/pandas.DataFrame.from_csv
357357
generated/pandas.DataFrame.from_dict,../reference/api/pandas.DataFrame.from_dict
358358
generated/pandas.DataFrame.from_items,../reference/api/pandas.DataFrame.from_items
359359
generated/pandas.DataFrame.from_records,../reference/api/pandas.DataFrame.from_records
360-
generated/pandas.DataFrame.ftypes,../reference/api/pandas.DataFrame.ftypes
361360
generated/pandas.DataFrame.ge,../reference/api/pandas.DataFrame.ge
362361
generated/pandas.DataFrame.get_dtype_counts,../reference/api/pandas.DataFrame.get_dtype_counts
363-
generated/pandas.DataFrame.get_ftype_counts,../reference/api/pandas.DataFrame.get_ftype_counts
364362
generated/pandas.DataFrame.get,../reference/api/pandas.DataFrame.get
365363
generated/pandas.DataFrame.get_value,../reference/api/pandas.DataFrame.get_value
366364
generated/pandas.DataFrame.get_values,../reference/api/pandas.DataFrame.get_values
@@ -883,10 +881,8 @@ generated/pandas.Panel.first_valid_index,../reference/api/pandas.Panel.first_val
883881
generated/pandas.Panel.floordiv,../reference/api/pandas.Panel.floordiv
884882
generated/pandas.Panel.from_dict,../reference/api/pandas.Panel.from_dict
885883
generated/pandas.Panel.fromDict,../reference/api/pandas.Panel.fromDict
886-
generated/pandas.Panel.ftypes,../reference/api/pandas.Panel.ftypes
887884
generated/pandas.Panel.ge,../reference/api/pandas.Panel.ge
888885
generated/pandas.Panel.get_dtype_counts,../reference/api/pandas.Panel.get_dtype_counts
889-
generated/pandas.Panel.get_ftype_counts,../reference/api/pandas.Panel.get_ftype_counts
890886
generated/pandas.Panel.get,../reference/api/pandas.Panel.get
891887
generated/pandas.Panel.get_value,../reference/api/pandas.Panel.get_value
892888
generated/pandas.Panel.get_values,../reference/api/pandas.Panel.get_values
@@ -1223,11 +1219,8 @@ generated/pandas.Series.flags,../reference/api/pandas.Series.flags
12231219
generated/pandas.Series.floordiv,../reference/api/pandas.Series.floordiv
12241220
generated/pandas.Series.from_array,../reference/api/pandas.Series.from_array
12251221
generated/pandas.Series.from_csv,../reference/api/pandas.Series.from_csv
1226-
generated/pandas.Series.ftype,../reference/api/pandas.Series.ftype
1227-
generated/pandas.Series.ftypes,../reference/api/pandas.Series.ftypes
12281222
generated/pandas.Series.ge,../reference/api/pandas.Series.ge
12291223
generated/pandas.Series.get_dtype_counts,../reference/api/pandas.Series.get_dtype_counts
1230-
generated/pandas.Series.get_ftype_counts,../reference/api/pandas.Series.get_ftype_counts
12311224
generated/pandas.Series.get,../reference/api/pandas.Series.get
12321225
generated/pandas.Series.get_value,../reference/api/pandas.Series.get_value
12331226
generated/pandas.Series.get_values,../reference/api/pandas.Series.get_values

doc/source/reference/frame.rst

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Attributes and underlying data
2828
:toctree: api/
2929

3030
DataFrame.dtypes
31-
DataFrame.ftypes
3231
DataFrame.get_dtype_counts
3332
DataFrame.select_dtypes
3433
DataFrame.values

doc/source/reference/series.rst

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Attributes
2929
Series.array
3030
Series.values
3131
Series.dtype
32-
Series.ftype
3332
Series.shape
3433
Series.nbytes
3534
Series.ndim
@@ -43,7 +42,6 @@ Attributes
4342
Series.flags
4443
Series.empty
4544
Series.dtypes
46-
Series.ftypes
4745
Series.data
4846
Series.name
4947
Series.put

doc/source/user_guide/scale.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Use efficient datatypes
9494

9595
The default pandas data types are not the most memory efficient. This is
9696
especially true for text data columns with relatively few unique values (commonly
97-
referred to as "low-cardinality" data). By using more efficient data types you
97+
referred to as "low-cardinality" data). By using more efficient data types, you
9898
can store larger datasets in memory.
9999

100100
.. ipython:: python

doc/source/user_guide/timeseries.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ There are several time/date properties that one can access from ``Timestamp`` or
772772
week,"The week ordinal of the year"
773773
dayofweek,"The number of the day of the week with Monday=0, Sunday=6"
774774
weekday,"The number of the day of the week with Monday=0, Sunday=6"
775-
weekday_name,"The name of the day in a week (ex: Friday)"
776775
quarter,"Quarter of the date: Jan-Mar = 1, Apr-Jun = 2, etc."
777776
days_in_month,"The number of days in the month of the datetime"
778777
is_month_start,"Logical indicating if first day of month (defined by frequency)"
@@ -1591,18 +1590,18 @@ labels.
15911590
15921591
s = pd.date_range('2000-01-01', '2000-01-05').to_series()
15931592
s.iloc[2] = pd.NaT
1594-
s.dt.weekday_name
1593+
s.dt.day_name()
15951594
15961595
# default: label='left', closed='left'
1597-
s.resample('B').last().dt.weekday_name
1596+
s.resample('B').last().dt.day_name()
15981597
15991598
Notice how the value for Sunday got pulled back to the previous Friday.
16001599
To get the behavior where the value for Sunday is pushed to Monday, use
16011600
instead
16021601

16031602
.. ipython:: python
16041603
1605-
s.resample('B', label='right', closed='right').last().dt.weekday_name
1604+
s.resample('B', label='right', closed='right').last().dt.day_name()
16061605
16071606
The ``axis`` parameter can be set to 0 or 1 and allows you to resample the
16081607
specified axis for a ``DataFrame``.

doc/source/whatsnew/v1.0.0.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,14 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
402402
**Other removals**
403403

404404
- Floordiv of integer-dtyped array by :class:`Timedelta` now raises ``TypeError`` (:issue:`21036`)
405+
- :func:`pandas.api.types.infer_dtype` argument ``skipna`` defaults to ``True`` instead of ``False`` (:issue:`24050`)
405406
- Removed the previously deprecated :meth:`Index.summary` (:issue:`18217`)
407+
- Removed the previously deprecated "fastpath" keyword from the :class:`Index` constructor (:issue:`23110`)
406408
- Removed the previously deprecated :meth:`Series.get_value`, :meth:`Series.set_value`, :meth:`DataFrame.get_value`, :meth:`DataFrame.set_value` (:issue:`17739`)
407409
- Changed the the default value of `inplace` in :meth:`DataFrame.set_index` and :meth:`Series.set_axis`. It now defaults to False (:issue:`27600`)
410+
- Removed the previously deprecated :attr:`Series.cat.categorical`, :attr:`Series.cat.index`, :attr:`Series.cat.name` (:issue:`24751`)
408411
- Removed support for nested renaming in :meth:`DataFrame.aggregate`, :meth:`Series.aggregate`, :meth:`DataFrameGroupBy.aggregate`, :meth:`SeriesGroupBy.aggregate`, :meth:`Rolling.aggregate` (:issue:`18529`)
412+
- Passing ``datetime64`` data to :class:`TimedeltaIndex` or ``timedelta64`` data to ``DatetimeIndex`` now raises ``TypeError`` (:issue:`23539`, :issue:`23937`)
409413
- A tuple passed to :meth:`DataFrame.groupby` is now exclusively treated as a single key (:issue:`18314`)
410414
- Removed :meth:`Series.from_array` (:issue:`18258`)
411415
- Removed :meth:`DataFrame.from_items` (:issue:`18458`)
@@ -439,6 +443,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
439443
- Removed the previously deprecated :meth:`Series.valid`; use :meth:`Series.dropna` instead (:issue:`18800`)
440444
- Removed the previously properties :attr:`DataFrame.is_copy`, :attr:`Series.is_copy` (:issue:`18812`)
441445
- Removed the previously deprecated :meth:`DataFrame.get_ftype_counts`, :meth:`Series.get_ftype_counts` (:issue:`18243`)
446+
- Removed the previously deprecated :meth:`DataFrame.ftypes`, :meth:`Series.ftypes`, :meth:`Series.ftype` (:issue:`26744`)
442447
- Removed the previously deprecated :meth:`Index.get_duplicated`, use ``idx[idx.duplicated()].unique()`` instead (:issue:`20239`)
443448
- Removed the previously deprecated :meth:`Series.clip_upper`, :meth:`Series.clip_lower`, :meth:`DataFrame.clip_upper`, :meth:`DataFrame.clip_lower` (:issue:`24203`)
444449
- Removed the ability to alter :attr:`DatetimeIndex.freq`, :attr:`TimedeltaIndex.freq`, or :attr:`PeriodIndex.freq` (:issue:`20772`)
@@ -452,6 +457,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
452457
- Removed previously deprecated keyword "n" from :meth:`DatetimeIndex.shift`, :meth:`TimedeltaIndex.shift`, :meth:`PeriodIndex.shift`, use "periods" instead (:issue:`22458`)
453458
- Changed the default value for the `raw` argument in :func:`Series.rolling().apply() <pandas.core.window.Rolling.apply>`, :func:`DataFrame.rolling().apply() <pandas.core.window.Rolling.apply>`,
454459
- :func:`Series.expanding().apply() <pandas.core.window.Expanding.apply>`, and :func:`DataFrame.expanding().apply() <pandas.core.window.Expanding.apply>` to ``False`` (:issue:`20584`)
460+
- Removed previously deprecated :attr:`Timestamp.weekday_name`, :attr:`DatetimeIndex.weekday_name`, and :attr:`Series.dt.weekday_name` (:issue:`18164`)
455461
-
456462

457463
.. _whatsnew_1000.performance:
@@ -533,7 +539,8 @@ Numeric
533539
- Improved error message when using `frac` > 1 and `replace` = False (:issue:`27451`)
534540
- Bug in numeric indexes resulted in it being possible to instantiate an :class:`Int64Index`, :class:`UInt64Index`, or :class:`Float64Index` with an invalid dtype (e.g. datetime-like) (:issue:`29539`)
535541
- Bug in :class:`UInt64Index` precision loss while constructing from a list with values in the ``np.uint64`` range (:issue:`29526`)
536-
-
542+
- Bug in :class:`NumericIndex` construction that caused indexing to fail when integers in the ``np.uint64`` range were used (:issue:`28023`)
543+
- Bug in :class:`NumericIndex` construction that caused :class:`UInt64Index` to be casted to :class:`Float64Index` when integers in the ``np.uint64`` range were used to index a :class:`DataFrame` (:issue:`28279`)
537544

538545
Conversion
539546
^^^^^^^^^^

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dependencies:
7878
- fastparquet>=0.3.2 # pandas.read_parquet, DataFrame.to_parquet
7979
- html5lib # pandas.read_html
8080
- lxml # pandas.read_html
81-
- openpyxl # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
81+
- openpyxl<=3.0.1 # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
8282
- pyarrow>=0.13.1 # pandas.read_parquet, DataFrame.to_parquet, pandas.read_feather, DataFrame.to_feather
8383
- pyqt>=5.9.2 # pandas.read_clipboard
8484
- pytables>=3.4.2 # pandas.read_hdf, DataFrame.to_hdf

pandas/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
_np_version_under1p15,
2525
_np_version_under1p16,
2626
_np_version_under1p17,
27+
_np_version_under1p18,
2728
)
2829

2930
try:

pandas/_libs/internals.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cdef class BlockPlacement:
5454
else:
5555
v = self._as_array
5656

57-
return f'{self.__class__.__name__}({v})'
57+
return f'{type(self).__name__}({v})'
5858

5959
def __repr__(self) -> str:
6060
return str(self)

0 commit comments

Comments
 (0)