Skip to content

Commit 99aca53

Browse files
committed
Merge branch 'master' into 2d-object-dont-copy
2 parents f951246 + 0333143 commit 99aca53

Some content is hidden

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

41 files changed

+1093
-597
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
- template: ci/azure/posix.yml
2222
parameters:
2323
name: macOS
24-
vmImage: macOS-10.14
24+
vmImage: macOS-10.15
2525

2626
- template: ci/azure/windows.yml
2727
parameters:
2828
name: Windows
29-
vmImage: vs2017-win2016
29+
vmImage: windows-2019
3030

3131
- job: py38_32bit
3232
pool:

ci/deps/actions-39-slow.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,29 @@ dependencies:
1414

1515
# pandas dependencies
1616
- beautifulsoup4
17-
- fsspec>=0.7.4, <2021.6.0
17+
- bottleneck
18+
- fsspec>=0.8.0, <2021.6.0
19+
- gcsfs
1820
- html5lib
21+
- jinja2
1922
- lxml
2023
- matplotlib
24+
- moto>=1.3.14
25+
- flask
2126
- numexpr
2227
- numpy
2328
- openpyxl
24-
- patsy
25-
- psycopg2
26-
- pymysql
29+
- pyarrow
2730
- pytables
2831
- python-dateutil
2932
- pytz
30-
- s3fs>=0.4.0
31-
- moto>=1.3.14
33+
- s3fs>=0.4.2
3234
- scipy
3335
- sqlalchemy
3436
- xlrd
3537
- xlsxwriter
36-
- moto
37-
- flask
38-
- numba
38+
- xlwt
39+
- pyreadstat
40+
- pip
41+
- pip:
42+
- pyxlsb

ci/deps/actions-39.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,30 @@ dependencies:
1212
- hypothesis>=5.5.3
1313

1414
# pandas dependencies
15+
- beautifulsoup4
16+
- bottleneck
17+
- fsspec>=0.8.0, <2021.6.0
18+
- gcsfs
19+
- html5lib
20+
- jinja2
21+
- lxml
22+
- matplotlib
23+
- moto>=1.3.14
24+
- flask
25+
- numexpr
1526
- numpy
27+
- openpyxl
28+
- pyarrow
29+
- pytables
1630
- python-dateutil
1731
- pytz
18-
19-
# optional dependencies
20-
- pytables
32+
- s3fs>=0.4.2
2133
- scipy
22-
- pyarrow=1.0
34+
- sqlalchemy
35+
- xlrd
36+
- xlsxwriter
37+
- xlwt
38+
- pyreadstat
39+
- pip
40+
- pip:
41+
- pyxlsb

doc/source/development/contributing_codebase.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,21 @@ Changes should be reflected in the release notes located in ``doc/source/whatsne
812812
This file contains an ongoing change log for each release. Add an entry to this file to
813813
document your fix, enhancement or (unavoidable) breaking change. Make sure to include the
814814
GitHub issue number when adding your entry (using ``:issue:`1234``` where ``1234`` is the
815-
issue/pull request number).
815+
issue/pull request number). Your entry should be written using full sentences and proper
816+
grammar.
817+
818+
When mentioning parts of the API, use a Sphinx ``:func:``, ``:meth:``, or ``:class:``
819+
directive as appropriate. Not all public API functions and methods have a
820+
documentation page; ideally links would only be added if they resolve. You can
821+
usually find similar examples by checking the release notes for one of the previous
822+
versions.
823+
824+
If your code is a bugfix, add your entry to the relevant bugfix section. Avoid
825+
adding to the ``Other`` section; only in rare cases should entries go there.
826+
Being as concise as possible, the description of the bug should include how the
827+
user may encounter it and an indication of the bug itself, e.g.
828+
"produces incorrect results" or "incorrectly raises". It may be necessary to also
829+
indicate the new behavior.
816830

817831
If your code is an enhancement, it is most likely necessary to add usage
818832
examples to the existing documentation. This can be done following the section

doc/source/user_guide/style.ipynb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,9 @@
11901190
"cell_type": "markdown",
11911191
"metadata": {},
11921192
"source": [
1193-
"In version 0.20.0 the ability to customize the bar chart further was given. You can now have the `df.style.bar` be centered on zero or midpoint value (in addition to the already existing way of having the min value at the left side of the cell), and you can pass a list of `[color_negative, color_positive]`.\n",
1193+
"Additional keyword arguments give more control on centering and positioning, and you can pass a list of `[color_negative, color_positive]` to highlight lower and higher values.\n",
11941194
"\n",
1195-
"Here's how you can change the above with the new `align='mid'` option:"
1195+
"Here's how you can change the above with the new `align` option, combined with setting `vmin` and `vmax` limits, the `width` of the figure, and underlying css `props` of cells, leaving space to display the text and the bars:"
11961196
]
11971197
},
11981198
{
@@ -1201,7 +1201,8 @@
12011201
"metadata": {},
12021202
"outputs": [],
12031203
"source": [
1204-
"df2.style.bar(subset=['A', 'B'], align='mid', color=['#d65f5f', '#5fba7d'])"
1204+
"df2.style.bar(align=0, vmin=-2.5, vmax=2.5, color=['#d65f5f', '#5fba7d'],\n",
1205+
" width=60, props=\"width: 120px; border-right: 1px solid black;\").format('{:.3f}', na_rep=\"\")"
12051206
]
12061207
},
12071208
{
@@ -1225,28 +1226,31 @@
12251226
"\n",
12261227
"# Test series\n",
12271228
"test1 = pd.Series([-100,-60,-30,-20], name='All Negative')\n",
1228-
"test2 = pd.Series([10,20,50,100], name='All Positive')\n",
1229-
"test3 = pd.Series([-10,-5,0,90], name='Both Pos and Neg')\n",
1229+
"test2 = pd.Series([-10,-5,0,90], name='Both Pos and Neg')\n",
1230+
"test3 = pd.Series([10,20,50,100], name='All Positive')\n",
1231+
"test4 = pd.Series([100, 103, 101, 102], name='Large Positive')\n",
1232+
"\n",
12301233
"\n",
12311234
"head = \"\"\"\n",
12321235
"<table>\n",
12331236
" <thead>\n",
12341237
" <th>Align</th>\n",
12351238
" <th>All Negative</th>\n",
1236-
" <th>All Positive</th>\n",
12371239
" <th>Both Neg and Pos</th>\n",
1240+
" <th>All Positive</th>\n",
1241+
" <th>Large Positive</th>\n",
12381242
" </thead>\n",
12391243
" </tbody>\n",
12401244
"\n",
12411245
"\"\"\"\n",
12421246
"\n",
1243-
"aligns = ['left','zero','mid']\n",
1247+
"aligns = ['left', 'right', 'zero', 'mid', 'mean', 99]\n",
12441248
"for align in aligns:\n",
12451249
" row = \"<tr><th>{}</th>\".format(align)\n",
1246-
" for series in [test1,test2,test3]:\n",
1250+
" for series in [test1,test2,test3, test4]:\n",
12471251
" s = series.copy()\n",
12481252
" s.name=''\n",
1249-
" row += \"<td>{}</td>\".format(s.to_frame().style.bar(align=align, \n",
1253+
" row += \"<td>{}</td>\".format(s.to_frame().style.hide_index().bar(align=align, \n",
12501254
" color=['#d65f5f', '#5fba7d'], \n",
12511255
" width=100).render()) #testn['width']\n",
12521256
" row += '</tr>'\n",

doc/source/whatsnew/v1.0.0.rst

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,20 @@ maps labels to their new names along the default axis, is allowed to be passed b
338338
339339
*pandas 0.25.x*
340340

341-
.. code-block:: python
341+
.. code-block:: ipython
342342
343-
>>> df = pd.DataFrame([[1]])
344-
>>> df.rename({0: 1}, {0: 2})
343+
In [1]: df = pd.DataFrame([[1]])
344+
In [2]: df.rename({0: 1}, {0: 2})
345+
Out[2]:
345346
FutureWarning: ...Use named arguments to resolve ambiguity...
346347
2
347348
1 1
348349
349350
*pandas 1.0.0*
350351

351-
.. code-block:: python
352+
.. code-block:: ipython
352353
353-
>>> df.rename({0: 1}, {0: 2})
354+
In [3]: df.rename({0: 1}, {0: 2})
354355
Traceback (most recent call last):
355356
...
356357
TypeError: rename() takes from 1 to 2 positional arguments but 3 were given
@@ -359,26 +360,28 @@ Note that errors will now be raised when conflicting or potentially ambiguous ar
359360

360361
*pandas 0.25.x*
361362

362-
.. code-block:: python
363+
.. code-block:: ipython
363364
364-
>>> df.rename({0: 1}, index={0: 2})
365+
In [4]: df.rename({0: 1}, index={0: 2})
366+
Out[4]:
365367
0
366368
1 1
367369
368-
>>> df.rename(mapper={0: 1}, index={0: 2})
370+
In [5]: df.rename(mapper={0: 1}, index={0: 2})
371+
Out[5]:
369372
0
370373
2 1
371374
372375
*pandas 1.0.0*
373376

374-
.. code-block:: python
377+
.. code-block:: ipython
375378
376-
>>> df.rename({0: 1}, index={0: 2})
379+
In [6]: df.rename({0: 1}, index={0: 2})
377380
Traceback (most recent call last):
378381
...
379382
TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns'
380383
381-
>>> df.rename(mapper={0: 1}, index={0: 2})
384+
In [7]: df.rename(mapper={0: 1}, index={0: 2})
382385
Traceback (most recent call last):
383386
...
384387
TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns'
@@ -405,12 +408,12 @@ Extended verbose info output for :class:`~pandas.DataFrame`
405408

406409
*pandas 0.25.x*
407410

408-
.. code-block:: python
411+
.. code-block:: ipython
409412
410-
>>> df = pd.DataFrame({"int_col": [1, 2, 3],
413+
In [1]: df = pd.DataFrame({"int_col": [1, 2, 3],
411414
... "text_col": ["a", "b", "c"],
412415
... "float_col": [0.0, 0.1, 0.2]})
413-
>>> df.info(verbose=True)
416+
In [2]: df.info(verbose=True)
414417
<class 'pandas.core.frame.DataFrame'>
415418
RangeIndex: 3 entries, 0 to 2
416419
Data columns (total 3 columns):
@@ -440,14 +443,16 @@ Extended verbose info output for :class:`~pandas.DataFrame`
440443

441444
*pandas 0.25.x*
442445

443-
.. code-block:: python
446+
.. code-block:: ipython
444447
445-
>>> pd.array(["a", None])
448+
In [1]: pd.array(["a", None])
449+
Out[1]:
446450
<PandasArray>
447451
['a', None]
448452
Length: 2, dtype: object
449453
450-
>>> pd.array([1, None])
454+
In [2]: pd.array([1, None])
455+
Out[2]:
451456
<PandasArray>
452457
[1, None]
453458
Length: 2, dtype: object
@@ -470,15 +475,17 @@ As a reminder, you can specify the ``dtype`` to disable all inference.
470475

471476
*pandas 0.25.x*
472477

473-
.. code-block:: python
478+
.. code-block:: ipython
474479
475-
>>> a = pd.array([1, 2, None], dtype="Int64")
476-
>>> a
480+
In [1]: a = pd.array([1, 2, None], dtype="Int64")
481+
In [2]: a
482+
Out[2]:
477483
<IntegerArray>
478484
[1, 2, NaN]
479485
Length: 3, dtype: Int64
480486
481-
>>> a[2]
487+
In [3]: a[2]
488+
Out[3]:
482489
nan
483490
484491
*pandas 1.0.0*
@@ -499,9 +506,10 @@ will now raise.
499506

500507
*pandas 0.25.x*
501508

502-
.. code-block:: python
509+
.. code-block:: ipython
503510
504-
>>> np.asarray(a, dtype="float")
511+
In [1]: np.asarray(a, dtype="float")
512+
Out[1]:
505513
array([ 1., 2., nan])
506514
507515
*pandas 1.0.0*
@@ -525,9 +533,10 @@ will now be ``pd.NA`` instead of ``np.nan`` in presence of missing values
525533

526534
*pandas 0.25.x*
527535

528-
.. code-block:: python
536+
.. code-block:: ipython
529537
530-
>>> pd.Series(a).sum(skipna=False)
538+
In [1]: pd.Series(a).sum(skipna=False)
539+
Out[1]:
531540
nan
532541
533542
*pandas 1.0.0*
@@ -543,9 +552,10 @@ integer dtype for the values.
543552

544553
*pandas 0.25.x*
545554

546-
.. code-block:: python
555+
.. code-block:: ipython
547556
548-
>>> pd.Series([2, 1, 1, None], dtype="Int64").value_counts().dtype
557+
In [1]: pd.Series([2, 1, 1, None], dtype="Int64").value_counts().dtype
558+
Out[1]:
549559
dtype('int64')
550560
551561
*pandas 1.0.0*
@@ -565,15 +575,17 @@ Comparison operations on a :class:`arrays.IntegerArray` now returns a
565575

566576
*pandas 0.25.x*
567577

568-
.. code-block:: python
578+
.. code-block:: ipython
569579
570-
>>> a = pd.array([1, 2, None], dtype="Int64")
571-
>>> a
580+
In [1]: a = pd.array([1, 2, None], dtype="Int64")
581+
In [2]: a
582+
Out[2]:
572583
<IntegerArray>
573584
[1, 2, NaN]
574585
Length: 3, dtype: Int64
575586
576-
>>> a > 1
587+
In [3]: a > 1
588+
Out[3]:
577589
array([False, True, False])
578590
579591
*pandas 1.0.0*
@@ -640,9 +652,10 @@ scalar values in the result are instances of the extension dtype's scalar type.
640652
641653
*pandas 0.25.x*
642654

643-
.. code-block:: python
655+
.. code-block:: ipython
644656
645-
>>> df.resample("2D").agg(lambda x: 'a').A.dtype
657+
In [1]> df.resample("2D").agg(lambda x: 'a').A.dtype
658+
Out[1]:
646659
CategoricalDtype(categories=['a', 'b'], ordered=False)
647660
648661
*pandas 1.0.0*
@@ -657,9 +670,10 @@ depending on how the results are cast back to the original dtype.
657670

658671
*pandas 0.25.x*
659672

660-
.. code-block:: python
673+
.. code-block:: ipython
661674
662-
>>> df.resample("2D").agg(lambda x: 'c')
675+
In [1] df.resample("2D").agg(lambda x: 'c')
676+
Out[1]:
663677
664678
A
665679
0 NaN
@@ -871,10 +885,10 @@ matplotlib directly rather than :meth:`~DataFrame.plot`.
871885

872886
To use pandas formatters with a matplotlib plot, specify
873887

874-
.. code-block:: python
888+
.. code-block:: ipython
875889
876-
>>> import pandas as pd
877-
>>> pd.options.plotting.matplotlib.register_converters = True
890+
In [1]: import pandas as pd
891+
In [2]: pd.options.plotting.matplotlib.register_converters = True
878892
879893
Note that plots created by :meth:`DataFrame.plot` and :meth:`Series.plot` *do* register the converters
880894
automatically. The only behavior change is when plotting a date-like object via ``matplotlib.pyplot.plot``

0 commit comments

Comments
 (0)