Skip to content

Commit b7c482e

Browse files
authored
Merge pull request #1 from TomAugspurger/harshit-py-merge_py_bug
Harshit py merge py bug
2 parents 7770b1d + 6b7f5a2 commit b7c482e

File tree

168 files changed

+2123
-651
lines changed

Some content is hidden

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

168 files changed

+2123
-651
lines changed

asv_bench/benchmarks/ctors.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ class SeriesConstructors:
5555
[False, True],
5656
['float', 'int']]
5757

58+
# Generators get exhausted on use, so run setup before every call
59+
number = 1
60+
repeat = (3, 250, 10)
61+
5862
def setup(self, data_fmt, with_index, dtype):
63+
if data_fmt in (gen_of_str, gen_of_tuples) and with_index:
64+
raise NotImplementedError('Series constructors do not support '
65+
'using generators with indexes')
5966
N = 10**4
6067
if dtype == 'float':
6168
arr = np.random.randn(N)

asv_bench/benchmarks/frame_ctor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class FromRecords:
7272
params = [None, 1000]
7373
param_names = ['nrows']
7474

75+
# Generators get exhausted on use, so run setup before every call
76+
number = 1
77+
repeat = (3, 250, 10)
78+
7579
def setup(self, nrows):
7680
N = 100000
7781
self.gen = ((x, (x * 20), (x * 100)) for x in range(N))

asv_bench/benchmarks/offset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pass
1010

1111
hcal = pd.tseries.holiday.USFederalHolidayCalendar()
12-
# These offests currently raise a NotImplimentedError with .apply_index()
12+
# These offsets currently raise a NotImplimentedError with .apply_index()
1313
non_apply = [pd.offsets.Day(),
1414
pd.offsets.BYearEnd(),
1515
pd.offsets.BYearBegin(),

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ fi
256256
### DOCSTRINGS ###
257257
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
258258

259-
MSG='Validate docstrings (GL03, GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA05)' ; echo $MSG
260-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA05
259+
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA05)' ; echo $MSG
260+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL04,GL05,GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA05
261261
RET=$(($RET + $?)) ; echo $MSG "DONE"
262262

263263
fi

doc/source/getting_started/comparison/comparison_with_sas.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ example, to subtract the mean for each observation by smoker group.
660660
run;
661661
662662
663-
pandas ``groubpy`` provides a ``transform`` mechanism that allows
663+
pandas ``groupby`` provides a ``transform`` mechanism that allows
664664
these type of operations to be succinctly expressed in one
665665
operation.
666666

doc/source/getting_started/comparison/comparison_with_stata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ For example, to subtract the mean for each observation by smoker group.
634634
generate adj_total_bill = total_bill - group_bill
635635
636636
637-
pandas ``groubpy`` provides a ``transform`` mechanism that allows
637+
pandas ``groupby`` provides a ``transform`` mechanism that allows
638638
these type of operations to be succinctly expressed in one
639639
operation.
640640

doc/source/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ psycopg2 PostgreSQL engine for sqlalchemy
286286
pyarrow 0.9.0 Parquet and feather reading / writing
287287
pymysql MySQL engine for sqlalchemy
288288
pyreadstat SPSS files (.sav) reading
289+
pytables 3.4.2 HDF5 reading / writing
289290
qtpy Clipboard I/O
290291
s3fs 0.0.8 Amazon S3 access
291292
xarray 0.8.2 pandas-like API for N-dimensional data

doc/source/user_guide/io.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ specification:
488488
489489
.. versionadded:: 0.21.0
490490

491-
Specifying ``dtype='cateogry'`` will result in an unordered ``Categorical``
491+
Specifying ``dtype='category'`` will result in an unordered ``Categorical``
492492
whose ``categories`` are the unique values observed in the data. For more
493493
control on the categories and order, create a
494494
:class:`~pandas.api.types.CategoricalDtype` ahead of time, and pass that for
@@ -1679,7 +1679,7 @@ S3 URLs are handled as well but require installing the `S3Fs
16791679
16801680
df = pd.read_csv('s3://pandas-test/tips.csv')
16811681
1682-
If your S3 bucket requires cedentials you will need to set them as environment
1682+
If your S3 bucket requires credentials you will need to set them as environment
16831683
variables or in the ``~/.aws/credentials`` config file, refer to the `S3Fs
16841684
documentation on credentials
16851685
<https://s3fs.readthedocs.io/en/latest/#credentials>`_.
@@ -2078,7 +2078,7 @@ Dates written in nanoseconds need to be read back in nanoseconds:
20782078
20792079
json = dfj2.to_json(date_unit='ns')
20802080
2081-
# Try to parse timestamps as millseconds -> Won't Work
2081+
# Try to parse timestamps as milliseconds -> Won't Work
20822082
dfju = pd.read_json(json, date_unit='ms')
20832083
dfju
20842084

doc/source/user_guide/options.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ compute.use_bottleneck True Use the bottleneck library
431431
computation if it is installed.
432432
compute.use_numexpr True Use the numexpr library to accelerate
433433
computation if it is installed.
434+
plotting.backend matplotlib Change the plotting backend to a different
435+
backend than the current matplotlib one.
436+
Backends can be implemented as third-party
437+
libraries implementing the pandas plotting
438+
API. They can use other plotting libraries
439+
like Bokeh, Altair, etc.
434440
plotting.matplotlib.register_converters True Register custom converters with
435441
matplotlib. Set to False to de-register.
436442
======================================= ============ ==================================

doc/source/user_guide/timeseries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ Valid business hours are distinguished by whether it started from valid ``Busine
11331133
pd.Timestamp('2014-08-01 17:00') + bh
11341134
pd.Timestamp('2014-08-01 23:00') + bh
11351135
1136-
# Although 2014-08-02 is Satuaday,
1136+
# Although 2014-08-02 is Saturday,
11371137
# it is valid because it starts from 08-01 (Friday).
11381138
pd.Timestamp('2014-08-02 04:00') + bh
11391139

doc/source/whatsnew/v0.10.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ combined result, by using ``where`` on a selector table.
170170
df_mt, selector='df1_mt')
171171
store
172172
173-
# indiviual tables were created
173+
# individual tables were created
174174
store.select('df1_mt')
175175
store.select('df2_mt')
176176

doc/source/whatsnew/v0.14.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ Enhancements
816816
- Implemented ``Panel.pct_change`` (:issue:`6904`)
817817
- Added ``how`` option to rolling-moment functions to dictate how to handle resampling; :func:`rolling_max` defaults to max,
818818
:func:`rolling_min` defaults to min, and all others default to mean (:issue:`6297`)
819-
- ``CustomBuisnessMonthBegin`` and ``CustomBusinessMonthEnd`` are now available (:issue:`6866`)
819+
- ``CustomBusinessMonthBegin`` and ``CustomBusinessMonthEnd`` are now available (:issue:`6866`)
820820
- :meth:`Series.quantile` and :meth:`DataFrame.quantile` now accept an array of
821821
quantiles.
822822
- :meth:`~DataFrame.describe` now accepts an array of percentiles to include in the summary statistics (:issue:`4196`)

doc/source/whatsnew/v0.14.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Bug Fixes
247247
- Bug in ``DatetimeIndex`` comparison doesn't handle ``NaT`` properly (:issue:`7529`)
248248
- Bug in passing input with ``tzinfo`` to some offsets ``apply``, ``rollforward`` or ``rollback`` resets ``tzinfo`` or raises ``ValueError`` (:issue:`7465`)
249249
- Bug in ``DatetimeIndex.to_period``, ``PeriodIndex.asobject``, ``PeriodIndex.to_timestamp`` doesn't preserve ``name`` (:issue:`7485`)
250-
- Bug in ``DatetimeIndex.to_period`` and ``PeriodIndex.to_timestanp`` handle ``NaT`` incorrectly (:issue:`7228`)
250+
- Bug in ``DatetimeIndex.to_period`` and ``PeriodIndex.to_timestamp`` handle ``NaT`` incorrectly (:issue:`7228`)
251251
- Bug in ``offsets.apply``, ``rollforward`` and ``rollback`` may return normal ``datetime`` (:issue:`7502`)
252252
- Bug in ``resample`` raises ``ValueError`` when target contains ``NaT`` (:issue:`7227`)
253253
- Bug in ``Timestamp.tz_localize`` resets ``nanosecond`` info (:issue:`7534`)

doc/source/whatsnew/v0.19.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@ Bug Fixes
15131513
- Bug in ``Series`` comparison may output incorrect result if rhs contains ``NaT`` (:issue:`9005`)
15141514
- Bug in ``Series`` and ``Index`` comparison may output incorrect result if it contains ``NaT`` with ``object`` dtype (:issue:`13592`)
15151515
- Bug in ``Period`` addition raises ``TypeError`` if ``Period`` is on right hand side (:issue:`13069`)
1516-
- Bug in ``Peirod`` and ``Series`` or ``Index`` comparison raises ``TypeError`` (:issue:`13200`)
1516+
- Bug in ``Period`` and ``Series`` or ``Index`` comparison raises ``TypeError`` (:issue:`13200`)
15171517
- Bug in ``pd.set_eng_float_format()`` that would prevent NaN and Inf from formatting (:issue:`11981`)
15181518
- Bug in ``.unstack`` with ``Categorical`` dtype resets ``.ordered`` to ``True`` (:issue:`13249`)
15191519
- Clean some compile time warnings in datetime parsing (:issue:`13607`)

doc/source/whatsnew/v0.21.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Now, to find prices per store/product, we can simply do:
263263
See the :ref:`documentation <groupby.pipe>` for more.
264264

265265

266-
.. _whatsnew_0210.enhancements.reanme_categories:
266+
.. _whatsnew_0210.enhancements.rename_categories:
267267

268268
``Categorical.rename_categories`` accepts a dict-like
269269
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -418,7 +418,7 @@ New Behavior, without regard to the bottleneck installation:
418418
419419
s.sum()
420420
421-
Note that this also changes the sum of an empty ``Series``. Previously this always returned 0 regardless of a ``bottlenck`` installation:
421+
Note that this also changes the sum of an empty ``Series``. Previously this always returned 0 regardless of a ``bottleneck`` installation:
422422

423423
.. code-block:: ipython
424424

doc/source/whatsnew/v0.23.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ To show only observed values:
276276
277277
df.groupby(['A', 'B', 'C'], observed=True).count()
278278
279-
For pivotting operations, this behavior is *already* controlled by the ``dropna`` keyword:
279+
For pivoting operations, this behavior is *already* controlled by the ``dropna`` keyword:
280280

281281
.. ipython:: python
282282

doc/source/whatsnew/v0.23.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Fixed Regressions
2626
**Comparing Series with datetime.date**
2727

2828
We've reverted a 0.23.0 change to comparing a :class:`Series` holding datetimes and a ``datetime.date`` object (:issue:`21152`).
29-
In pandas 0.22 and earlier, comparing a Series holding datetimes and ``datetime.date`` objects would coerce the ``datetime.date`` to a datetime before comapring.
29+
In pandas 0.22 and earlier, comparing a Series holding datetimes and ``datetime.date`` objects would coerce the ``datetime.date`` to a datetime before comparing.
3030
This was inconsistent with Python, NumPy, and :class:`DatetimeIndex`, which never consider a datetime and ``datetime.date`` equal.
3131

3232
In 0.23.0, we unified operations between DatetimeIndex and Series, and in the process changed comparisons between a Series of datetimes and ``datetime.date`` without warning.

doc/source/whatsnew/v0.24.0.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ The affected cases are:
10611061
10621062
.. code-block:: ipython
10631063
1064-
# Comparison operations and arithmetic opeartions both raise ValueError.
1064+
# Comparison operations and arithmetic operations both raise ValueError.
10651065
In [6]: df == (1, 2, 3)
10661066
...
10671067
ValueError: Unable to coerce to Series, length must be 2: given 3
@@ -1324,7 +1324,7 @@ Deprecations
13241324
- :meth:`Series.clip_lower`, :meth:`Series.clip_upper`, :meth:`DataFrame.clip_lower` and :meth:`DataFrame.clip_upper` are deprecated and will be removed in a future version. Use ``Series.clip(lower=threshold)``, ``Series.clip(upper=threshold)`` and the equivalent ``DataFrame`` methods (:issue:`24203`)
13251325
- :meth:`Series.nonzero` is deprecated and will be removed in a future version (:issue:`18262`)
13261326
- Passing an integer to :meth:`Series.fillna` and :meth:`DataFrame.fillna` with ``timedelta64[ns]`` dtypes is deprecated, will raise ``TypeError`` in a future version. Use ``obj.fillna(pd.Timedelta(...))`` instead (:issue:`24694`)
1327-
- ``Series.cat.categorical``, ``Series.cat.name`` and ``Sersies.cat.index`` have been deprecated. Use the attributes on ``Series.cat`` or ``Series`` directly. (:issue:`24751`).
1327+
- ``Series.cat.categorical``, ``Series.cat.name`` and ``Series.cat.index`` have been deprecated. Use the attributes on ``Series.cat`` or ``Series`` directly. (:issue:`24751`).
13281328
- Passing a dtype without a precision like ``np.dtype('datetime64')`` or ``timedelta64`` to :class:`Index`, :class:`DatetimeIndex` and :class:`TimedeltaIndex` is now deprecated. Use the nanosecond-precision dtype instead (:issue:`24753`).
13291329

13301330
.. _whatsnew_0240.deprecations.datetimelike_int_ops:
@@ -1604,7 +1604,7 @@ Datetimelike
16041604
- Bug in :class:`DatetimeIndex` where calling ``np.array(dtindex, dtype=object)`` would incorrectly return an array of ``long`` objects (:issue:`23524`)
16051605
- Bug in :class:`Index` where passing a timezone-aware :class:`DatetimeIndex` and `dtype=object` would incorrectly raise a ``ValueError`` (:issue:`23524`)
16061606
- Bug in :class:`Index` where calling ``np.array(dtindex, dtype=object)`` on a timezone-naive :class:`DatetimeIndex` would return an array of ``datetime`` objects instead of :class:`Timestamp` objects, potentially losing nanosecond portions of the timestamps (:issue:`23524`)
1607-
- Bug in :class:`Categorical.__setitem__` not allowing setting with another ``Categorical`` when both are undordered and have the same categories, but in a different order (:issue:`24142`)
1607+
- Bug in :class:`Categorical.__setitem__` not allowing setting with another ``Categorical`` when both are unordered and have the same categories, but in a different order (:issue:`24142`)
16081608
- Bug in :func:`date_range` where using dates with millisecond resolution or higher could return incorrect values or the wrong number of values in the index (:issue:`24110`)
16091609
- Bug in :class:`DatetimeIndex` where constructing a :class:`DatetimeIndex` from a :class:`Categorical` or :class:`CategoricalIndex` would incorrectly drop timezone information (:issue:`18664`)
16101610
- Bug in :class:`DatetimeIndex` and :class:`TimedeltaIndex` where indexing with ``Ellipsis`` would incorrectly lose the index's ``freq`` attribute (:issue:`21282`)
@@ -1670,7 +1670,7 @@ Timezones
16701670
Offsets
16711671
^^^^^^^
16721672

1673-
- Bug in :class:`FY5253` where date offsets could incorrectly raise an ``AssertionError`` in arithmetic operatons (:issue:`14774`)
1673+
- Bug in :class:`FY5253` where date offsets could incorrectly raise an ``AssertionError`` in arithmetic operations (:issue:`14774`)
16741674
- Bug in :class:`DateOffset` where keyword arguments ``week`` and ``milliseconds`` were accepted and ignored. Passing these will now raise ``ValueError`` (:issue:`19398`)
16751675
- Bug in adding :class:`DateOffset` with :class:`DataFrame` or :class:`PeriodIndex` incorrectly raising ``TypeError`` (:issue:`23215`)
16761676
- Bug in comparing :class:`DateOffset` objects with non-DateOffset objects, particularly strings, raising ``ValueError`` instead of returning ``False`` for equality checks and ``True`` for not-equal checks (:issue:`23524`)
@@ -1838,7 +1838,7 @@ Groupby/Resample/Rolling
18381838
``SeriesGroupBy`` when the grouping variable only contains NaNs and numpy version < 1.13 (:issue:`21956`).
18391839
- Multiple bugs in :func:`pandas.core.window.Rolling.min` with ``closed='left'`` and a
18401840
datetime-like index leading to incorrect results and also segfault. (:issue:`21704`)
1841-
- Bug in :meth:`pandas.core.resample.Resampler.apply` when passing postiional arguments to applied func (:issue:`14615`).
1841+
- Bug in :meth:`pandas.core.resample.Resampler.apply` when passing positional arguments to applied func (:issue:`14615`).
18421842
- Bug in :meth:`Series.resample` when passing ``numpy.timedelta64`` to ``loffset`` kwarg (:issue:`7687`).
18431843
- Bug in :meth:`pandas.core.resample.Resampler.asfreq` when frequency of ``TimedeltaIndex`` is a subperiod of a new frequency (:issue:`13022`).
18441844
- Bug in :meth:`pandas.core.groupby.SeriesGroupBy.mean` when values were integral but could not fit inside of int64, overflowing instead. (:issue:`22487`)

0 commit comments

Comments
 (0)