Skip to content
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

DOC: misc. typos #19876

Merged
merged 1 commit into from
Feb 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion doc/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2312,4 +2312,4 @@ All NumPy dtypes are subclasses of ``numpy.generic``:
.. note::

Pandas also defines the types ``category``, and ``datetime64[ns, tz]``, which are not integrated into the normal
NumPy hierarchy and wont show up with the above function.
NumPy hierarchy and won't show up with the above function.
2 changes: 1 addition & 1 deletion doc/source/dsintro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ To write code compatible with all versions of Python, split the assignment in tw
you'll need to take care when passing ``assign`` expressions that

* Updating an existing column
* Refering to the newly updated column in the same ``assign``
* Referring to the newly updated column in the same ``assign``

For example, we'll update column "A" and then refer to it when creating "B".

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.14.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Performance
~~~~~~~~~~~
- Improvements in dtype inference for numeric operations involving yielding performance gains for dtypes: ``int64``, ``timedelta64``, ``datetime64`` (:issue:`7223`)
- Improvements in Series.transform for significant performance gains (:issue:`6496`)
- Improvements in DataFrame.transform with ufuncs and built-in grouper functions for signifcant performance gains (:issue:`7383`)
- Improvements in DataFrame.transform with ufuncs and built-in grouper functions for significant performance gains (:issue:`7383`)
- Regression in groupby aggregation of datetime64 dtypes (:issue:`7555`)
- Improvements in `MultiIndex.from_product` for large iterables (:issue:`7627`)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/groupby_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def group_rank_{{name}}(ndarray[float64_t, ndim=2] out,
labels : array containing unique label for each group, with its ordering
matching up to the corresponding record in `values`
is_datetimelike : bool
unused in this method but provided for call compatability with other
unused in this method but provided for call compatibility with other
Cython transformations
ties_method : {'keep', 'top', 'bottom'}
* keep: leave NA values where they are
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def _from_inferred_categories(cls, inferred_categories, inferred_codes,
cats = to_timedelta(inferred_categories, errors='coerce')

if known_categories:
# recode from observation oder to dtype.categories order
# recode from observation order to dtype.categories order
categories = dtype.categories
codes = _recode_for_categories(inferred_codes, cats, categories)
elif not cats.is_monotonic_increasing:
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2600,12 +2600,12 @@ def __init__(self, values, placement, ndim=None):

def _maybe_coerce_values(self, values):
"""Input validation for values passed to __init__. Ensure that
we have datetime64ns, coercing if nescessary.
we have datetime64ns, coercing if necessary.
Parametetrs
-----------
values : array-like
Must be convertable to datetime64
Must be convertible to datetime64
Returns
-------
Expand Down Expand Up @@ -2760,12 +2760,12 @@ def __init__(self, values, placement, ndim=2, dtype=None):

def _maybe_coerce_values(self, values, dtype=None):
"""Input validation for values passed to __init__. Ensure that
we have datetime64TZ, coercing if nescessary.
we have datetime64TZ, coercing if necessary.
Parametetrs
-----------
values : array-like
Must be convertable to datetime64
Must be convertible to datetime64
dtype : string or DatetimeTZDtype, optional
Does a shallow copy to this tz
Expand Down
2 changes: 1 addition & 1 deletion pandas/plotting/_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __call__(self, x, pos=0):
----------
x : float
The time of day specified as seconds since 00:00 (midnight),
with upto microsecond precision.
with up to microsecond precision.
pos
Unused
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/category/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_align_frame(self, data, na_value):


class TestGetitem(base.BaseGetitemTests):
@pytest.mark.skip(reason="Backwards compatability")
@pytest.mark.skip(reason="Backwards compatibility")
def test_getitem_scalar(self):
# CategoricalDtype.type isn't "correct" since it should
# be a parent of the elements (object). But don't want
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def na_cmp():
Should return a function of two arguments that returns
True if both arguments are (scalar) NA for your type.
By defult, uses ``operator.or``
By default, uses ``operator.or``
"""
return operator.is_

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_mutate_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_assign_bad(self):
def test_assign_dependent_old_python(self):
df = DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})

# Key C does not exist at defition time of df
# Key C does not exist at definition time of df
with pytest.raises(KeyError):
df.assign(C=lambda df: df.A,
D=lambda df: df['A'] + df['C'])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_repr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_info_memory_usage(self):
res = buf.getvalue().splitlines()
assert "memory usage: " in res[-1]

# do not display memory usage cas
# do not display memory usage case
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review

df.info(buf=buf, memory_usage=False)
res = buf.getvalue().splitlines()
assert "memory usage: " not in res[-1]
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ def roundtrip(df, header=True, parser_hdr=0, index=True):
nrows = 5
ncols = 3
for use_headers in (True, False):
for i in range(1, 4): # row multindex upto nlevel=3
for i in range(1, 4): # row multindex up to nlevel=3
for j in range(1, 4): # col ""
df = mkdf(nrows, ncols, r_idx_nlevels=i, c_idx_nlevels=j)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def test_read_write_dta10(self):
with tm.ensure_clean() as path:
original.to_stata(path, {'datetime': 'tc'})
written_and_read_again = self.read_dta(path)
# original.index is np.int32, readed index is np.int64
# original.index is np.int32, read index is np.int64
tm.assert_frame_equal(written_and_read_again.set_index('index'),
original, check_index_type=False)

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/reshape/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def test_concat_categorical(self):
tm.assert_series_equal(pd.concat([s1, s2], ignore_index=True), exp)
tm.assert_series_equal(s1.append(s2, ignore_index=True), exp)

# completelly different categories (same dtype) => not-category
# completely different categories (same dtype) => not-category
s1 = pd.Series([10, 11, np.nan], dtype='category')
s2 = pd.Series([np.nan, 1, 3, 2], dtype='category')

Expand Down Expand Up @@ -518,7 +518,7 @@ def test_concat_categorical_coercion(self):
tm.assert_series_equal(pd.concat([s2, s1], ignore_index=True), exp)
tm.assert_series_equal(s2.append(s1, ignore_index=True), exp)

# completelly different categories => not-category
# completely different categories => not-category
s1 = pd.Series([10, 11, np.nan], dtype='category')
s2 = pd.Series([1, 3, 2])

Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/sparse/frame/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ def test_constructor_preserve_attr(self):
def test_constructor_nan_dataframe(self):
# GH 10079
trains = np.arange(100)
tresholds = [10, 20, 30, 40, 50, 60]
tuples = [(i, j) for i in trains for j in tresholds]
thresholds = [10, 20, 30, 40, 50, 60]
tuples = [(i, j) for i in trains for j in thresholds]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source code change, please review

index = pd.MultiIndex.from_tuples(tuples,
names=['trains', 'tresholds'])
names=['trains', 'thresholds'])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

matrix = np.empty((len(index), len(trains)))
matrix.fill(np.nan)
df = pd.DataFrame(matrix, index=index, columns=trains, dtype=float)
Expand Down