Skip to content

Commit

Permalink
Misc typos (#19430)
Browse files Browse the repository at this point in the history
Found via `codespell -q 3`
  • Loading branch information
luzpaz authored and jreback committed Jan 29, 2018
1 parent ad468e9 commit f483321
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions asv_bench/benchmarks/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class Convert(object):

goal_time = 0.5
params = (['DataFrame', 'Series'], ['Timestamp', 'Timedelta'])
param_names = ['contructor', 'replace_data']
param_names = ['constructor', 'replace_data']

def setup(self, contructor, replace_data):
def setup(self, constructor, replace_data):
N = 10**3
data = {'Series': pd.Series(np.random.randint(N, size=N)),
'DataFrame': pd.DataFrame({'A': np.random.randint(N, size=N),
'B': np.random.randint(N, size=N)})}
self.to_replace = {i: getattr(pd, replace_data) for i in range(N)}
self.data = data[contructor]
self.data = data[constructor]

def time_replace(self, contructor, replace_data):
def time_replace(self, constructor, replace_data):
self.data.replace(self.to_replace)
16 changes: 8 additions & 8 deletions asv_bench/benchmarks/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class Methods(object):
['int', 'float'],
['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt',
'sum', 'corr', 'cov'])
param_names = ['contructor', 'window', 'dtype', 'method']
param_names = ['constructor', 'window', 'dtype', 'method']

def setup(self, contructor, window, dtype, method):
def setup(self, constructor, window, dtype, method):
N = 10**5
arr = np.random.random(N).astype(dtype)
self.roll = getattr(pd, contructor)(arr).rolling(window)
self.roll = getattr(pd, constructor)(arr).rolling(window)

def time_rolling(self, contructor, window, dtype, method):
def time_rolling(self, constructor, window, dtype, method):
getattr(self.roll, method)()


Expand All @@ -30,12 +30,12 @@ class Quantile(object):
[10, 1000],
['int', 'float'],
[0, 0.5, 1])
param_names = ['contructor', 'window', 'dtype', 'percentile']
param_names = ['constructor', 'window', 'dtype', 'percentile']

def setup(self, contructor, window, dtype, percentile):
def setup(self, constructor, window, dtype, percentile):
N = 10**5
arr = np.random.random(N).astype(dtype)
self.roll = getattr(pd, contructor)(arr).rolling(window)
self.roll = getattr(pd, constructor)(arr).rolling(window)

def time_quantile(self, contructor, window, dtype, percentile):
def time_quantile(self, constructor, window, dtype, percentile):
self.roll.quantile(percentile)
2 changes: 1 addition & 1 deletion doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2500,7 +2500,7 @@ Scalar introspection
Extensions
----------

These are primarily intented for library authors looking to extend pandas
These are primarily intended for library authors looking to extend pandas
objects.

.. currentmodule:: pandas
Expand Down
2 changes: 1 addition & 1 deletion doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ file, and the ``sheet_name`` indicating which sheet to parse.
+++++++++++++++++++

To facilitate working with multiple sheets from the same file, the ``ExcelFile``
class can be used to wrap the file and can be be passed into ``read_excel``
class can be used to wrap the file and can be passed into ``read_excel``
There will be a performance benefit for reading multiple sheets as the file is
read into memory only once.

Expand Down
6 changes: 3 additions & 3 deletions doc/sphinxext/numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
-------
out : ndarray
The drawn samples, arranged according to `shape`. If the
shape given is (m,n,...), then the shape of `out` is is
shape given is (m,n,...), then the shape of `out` is
(m,n,...,N).
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
Expand Down Expand Up @@ -222,7 +222,7 @@ def test_str():
-------
out : ndarray
The drawn samples, arranged according to `shape`. If the
shape given is (m,n,...), then the shape of `out` is is
shape given is (m,n,...), then the shape of `out` is
(m,n,...,N).
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
Expand Down Expand Up @@ -340,7 +340,7 @@ def test_sphinx_str():
**out** : ndarray
The drawn samples, arranged according to `shape`. If the
shape given is (m,n,...), then the shape of `out` is is
shape given is (m,n,...), then the shape of `out` is
(m,n,...,N).
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ class Timedelta(_Timedelta):
Represents a duration, the difference between two dates or times.
Timedelta is the pandas equivalent of python's ``datetime.timedelta``
and is interchangable with it in most cases.
and is interchangeable with it in most cases.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ cpdef bint tz_compare(object start, object end):
timezones. For example
`<DstTzInfo 'Europe/Paris' LMT+0:09:00 STD>` and
`<DstTzInfo 'Europe/Paris' CET+1:00:00 STD>` are essentially same
timezones but aren't evaluted such, but the string representation
timezones but aren't evaluated such, but the string representation
for both of these is `'Europe/Paris'`.
This exists only to add a notion of equality to pytz-style zones
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4115,7 +4115,7 @@ def combine(self, other, func, fill_value=None, overwrite=True):
series[this_mask] = fill_value
otherSeries[other_mask] = fill_value

# if we have different dtypes, possibily promote
# if we have different dtypes, possibly promote
new_dtype = this_dtype
if not is_dtype_equal(this_dtype, other_dtype):
new_dtype = find_common_type([this_dtype, other_dtype])
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def freqstr(self):
@cache_readonly
def inferred_freq(self):
"""
Trys to return a string representing a frequency guess,
Tryies to return a string representing a frequency guess,
generated by infer_freq. Returns None if it can't autodetect the
frequency.
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, data=None, index=None, columns=None, default_kind=None,
if dtype is not None:
mgr = mgr.astype(dtype)
else:
msg = ('SparseDataFrame called with unkown type "{data_type}" '
msg = ('SparseDataFrame called with unknown type "{data_type}" '
'for data argument')
raise TypeError(msg.format(data_type=type(data).__name__))

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def _set_value(self, label, value, takeable=False):
values = self.to_dense()

# if the label doesn't exist, we will create a new object here
# and possibily change the index
# and possibly change the index
new_values = values._set_value(label, value, takeable=takeable)
if new_values is not None:
values = new_values
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ def _validate(data):
elif isinstance(data, Index):
# can't use ABCIndex to exclude non-str

# see scc/inferrence.pyx which can contain string values
# see src/inference.pyx which can contain string values
allowed_types = ('string', 'unicode', 'mixed', 'mixed-integer')
if data.inferred_type not in allowed_types:
message = ("Can only use .str accessor with string values "
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/util/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _hash_categorical(c, encoding, hash_key):

# we have uint64, as we don't directly support missing values
# we don't want to use take_nd which will coerce to float
# instead, directly construt the result with a
# instead, directly construct the result with a
# max(np.uint64) as the missing value indicator
#
# TODO: GH 15362
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ def formatter(value):
def get_result_as_array(self):
"""
Returns the float values converted into strings using
the parameters given at initalisation, as a numpy array
the parameters given at initialisation, as a numpy array
"""

if self.formatter is not None:
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3763,7 +3763,7 @@ def write(self, **kwargs):
class LegacyTable(Table):

""" an appendable table: allow append/query/delete operations to a
(possibily) already existing appendable table this table ALLOWS
(possibly) already existing appendable table this table ALLOWS
append (but doesn't require them), and stores the data in a format
that can be easily searched
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/categorical/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_constructor_from_categorical_with_unknown_dtype(self):
ordered=True)
tm.assert_categorical_equal(result, expected)

def test_contructor_from_categorical_string(self):
def test_constructor_from_categorical_string(self):
values = Categorical(['a', 'b', 'd'])
# use categories, ordered
result = Categorical(values, categories=['a', 'b', 'c'], ordered=True,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def test_nested_dict_frame_constructor(self):
tm.assert_frame_equal(result, df)

def _check_basic_constructor(self, empty):
# mat: 2d matrix with shpae (3, 2) to input. empty - makes sized
# mat: 2d matrix with shape (3, 2) to input. empty - makes sized
# objects
mat = empty((2, 3), dtype=float)
# 2-D input
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/formats/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,7 @@ def test_date_tz(self):
[datetime(2013, 1, 1), pd.NaT], utc=True).format()
assert formatted[0] == "2013-01-01 00:00:00+00:00"

def test_date_explict_date_format(self):
def test_date_explicit_date_format(self):
formatted = pd.to_datetime([datetime(2003, 2, 1), pd.NaT]).format(
date_format="%m-%d-%Y", na_rep="UT")
assert formatted[0] == "02-01-2003"
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_empty(self, method, unit, use_bottleneck):
result = getattr(s, method)()
assert result == unit

# Explict
# Explicit
result = getattr(s, method)(min_count=0)
assert result == unit

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ def test_timedelta_floordiv(self, scalar_td):
('NCC1701D', 'NCC1701D', 'NCC1701D')])
def test_td64_series_with_tdi(self, names):
# GH#17250 make sure result dtype is correct
# GH#19043 make sure names are propogated correctly
# GH#19043 make sure names are propagated correctly
tdi = pd.TimedeltaIndex(['0 days', '1 day'], name=names[0])
ser = Series([Timedelta(hours=3), Timedelta(hours=4)], name=names[1])
expected = Series([Timedelta(hours=3), Timedelta(days=1, hours=4)],
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/sparse/frame/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def test_constructor_from_unknown_type(self):
class Unknown:
pass
with pytest.raises(TypeError,
message='SparseDataFrame called with unkown type '
message='SparseDataFrame called with unknown type '
'"Unknown" for data argument'):
SparseDataFrame(Unknown())

Expand Down
2 changes: 1 addition & 1 deletion pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ class for all warnings. To check that no warning is returned,
into errors.
Valid values are:
* "error" - turns matching warnings into exeptions
* "error" - turns matching warnings into exceptions
* "ignore" - discard the warning
* "always" - always emit a warning
* "default" - print the warning the first time it is generated
Expand Down

0 comments on commit f483321

Please sign in to comment.