Skip to content

Commit f483321

Browse files
luzpazjreback
authored andcommitted
Misc typos (#19430)
Found via `codespell -q 3`
1 parent ad468e9 commit f483321

File tree

22 files changed

+34
-34
lines changed

22 files changed

+34
-34
lines changed

asv_bench/benchmarks/replace.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class Convert(object):
4444

4545
goal_time = 0.5
4646
params = (['DataFrame', 'Series'], ['Timestamp', 'Timedelta'])
47-
param_names = ['contructor', 'replace_data']
47+
param_names = ['constructor', 'replace_data']
4848

49-
def setup(self, contructor, replace_data):
49+
def setup(self, constructor, replace_data):
5050
N = 10**3
5151
data = {'Series': pd.Series(np.random.randint(N, size=N)),
5252
'DataFrame': pd.DataFrame({'A': np.random.randint(N, size=N),
5353
'B': np.random.randint(N, size=N)})}
5454
self.to_replace = {i: getattr(pd, replace_data) for i in range(N)}
55-
self.data = data[contructor]
55+
self.data = data[constructor]
5656

57-
def time_replace(self, contructor, replace_data):
57+
def time_replace(self, constructor, replace_data):
5858
self.data.replace(self.to_replace)

asv_bench/benchmarks/rolling.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class Methods(object):
1212
['int', 'float'],
1313
['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt',
1414
'sum', 'corr', 'cov'])
15-
param_names = ['contructor', 'window', 'dtype', 'method']
15+
param_names = ['constructor', 'window', 'dtype', 'method']
1616

17-
def setup(self, contructor, window, dtype, method):
17+
def setup(self, constructor, window, dtype, method):
1818
N = 10**5
1919
arr = np.random.random(N).astype(dtype)
20-
self.roll = getattr(pd, contructor)(arr).rolling(window)
20+
self.roll = getattr(pd, constructor)(arr).rolling(window)
2121

22-
def time_rolling(self, contructor, window, dtype, method):
22+
def time_rolling(self, constructor, window, dtype, method):
2323
getattr(self.roll, method)()
2424

2525

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

35-
def setup(self, contructor, window, dtype, percentile):
35+
def setup(self, constructor, window, dtype, percentile):
3636
N = 10**5
3737
arr = np.random.random(N).astype(dtype)
38-
self.roll = getattr(pd, contructor)(arr).rolling(window)
38+
self.roll = getattr(pd, constructor)(arr).rolling(window)
3939

40-
def time_quantile(self, contructor, window, dtype, percentile):
40+
def time_quantile(self, constructor, window, dtype, percentile):
4141
self.roll.quantile(percentile)

doc/source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2500,7 +2500,7 @@ Scalar introspection
25002500
Extensions
25012501
----------
25022502

2503-
These are primarily intented for library authors looking to extend pandas
2503+
These are primarily intended for library authors looking to extend pandas
25042504
objects.
25052505

25062506
.. currentmodule:: pandas

doc/source/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,7 @@ file, and the ``sheet_name`` indicating which sheet to parse.
26752675
+++++++++++++++++++
26762676

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

doc/sphinxext/numpydoc/tests/test_docscrape.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
-------
4343
out : ndarray
4444
The drawn samples, arranged according to `shape`. If the
45-
shape given is (m,n,...), then the shape of `out` is is
45+
shape given is (m,n,...), then the shape of `out` is
4646
(m,n,...,N).
4747
4848
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
@@ -222,7 +222,7 @@ def test_str():
222222
-------
223223
out : ndarray
224224
The drawn samples, arranged according to `shape`. If the
225-
shape given is (m,n,...), then the shape of `out` is is
225+
shape given is (m,n,...), then the shape of `out` is
226226
(m,n,...,N).
227227
228228
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
@@ -340,7 +340,7 @@ def test_sphinx_str():
340340
**out** : ndarray
341341
342342
The drawn samples, arranged according to `shape`. If the
343-
shape given is (m,n,...), then the shape of `out` is is
343+
shape given is (m,n,...), then the shape of `out` is
344344
(m,n,...,N).
345345
346346
In other words, each entry ``out[i,j,...,:]`` is an N-dimensional

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ class Timedelta(_Timedelta):
897897
Represents a duration, the difference between two dates or times.
898898
899899
Timedelta is the pandas equivalent of python's ``datetime.timedelta``
900-
and is interchangable with it in most cases.
900+
and is interchangeable with it in most cases.
901901
902902
Parameters
903903
----------

pandas/_libs/tslibs/timezones.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ cpdef bint tz_compare(object start, object end):
295295
timezones. For example
296296
`<DstTzInfo 'Europe/Paris' LMT+0:09:00 STD>` and
297297
`<DstTzInfo 'Europe/Paris' CET+1:00:00 STD>` are essentially same
298-
timezones but aren't evaluted such, but the string representation
298+
timezones but aren't evaluated such, but the string representation
299299
for both of these is `'Europe/Paris'`.
300300
301301
This exists only to add a notion of equality to pytz-style zones

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4115,7 +4115,7 @@ def combine(self, other, func, fill_value=None, overwrite=True):
41154115
series[this_mask] = fill_value
41164116
otherSeries[other_mask] = fill_value
41174117

4118-
# if we have different dtypes, possibily promote
4118+
# if we have different dtypes, possibly promote
41194119
new_dtype = this_dtype
41204120
if not is_dtype_equal(this_dtype, other_dtype):
41214121
new_dtype = find_common_type([this_dtype, other_dtype])

pandas/core/indexes/datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def freqstr(self):
332332
@cache_readonly
333333
def inferred_freq(self):
334334
"""
335-
Trys to return a string representing a frequency guess,
335+
Tryies to return a string representing a frequency guess,
336336
generated by infer_freq. Returns None if it can't autodetect the
337337
frequency.
338338
"""

pandas/core/sparse/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(self, data=None, index=None, columns=None, default_kind=None,
120120
if dtype is not None:
121121
mgr = mgr.astype(dtype)
122122
else:
123-
msg = ('SparseDataFrame called with unkown type "{data_type}" '
123+
msg = ('SparseDataFrame called with unknown type "{data_type}" '
124124
'for data argument')
125125
raise TypeError(msg.format(data_type=type(data).__name__))
126126

pandas/core/sparse/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def _set_value(self, label, value, takeable=False):
493493
values = self.to_dense()
494494

495495
# if the label doesn't exist, we will create a new object here
496-
# and possibily change the index
496+
# and possibly change the index
497497
new_values = values._set_value(label, value, takeable=takeable)
498498
if new_values is not None:
499499
values = new_values

pandas/core/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ def _validate(data):
13951395
elif isinstance(data, Index):
13961396
# can't use ABCIndex to exclude non-str
13971397

1398-
# see scc/inferrence.pyx which can contain string values
1398+
# see src/inference.pyx which can contain string values
13991399
allowed_types = ('string', 'unicode', 'mixed', 'mixed-integer')
14001400
if data.inferred_type not in allowed_types:
14011401
message = ("Can only use .str accessor with string values "

pandas/core/util/hashing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def _hash_categorical(c, encoding, hash_key):
210210

211211
# we have uint64, as we don't directly support missing values
212212
# we don't want to use take_nd which will coerce to float
213-
# instead, directly construt the result with a
213+
# instead, directly construct the result with a
214214
# max(np.uint64) as the missing value indicator
215215
#
216216
# TODO: GH 15362

pandas/io/formats/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ def formatter(value):
19611961
def get_result_as_array(self):
19621962
"""
19631963
Returns the float values converted into strings using
1964-
the parameters given at initalisation, as a numpy array
1964+
the parameters given at initialisation, as a numpy array
19651965
"""
19661966

19671967
if self.formatter is not None:

pandas/io/pytables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3763,7 +3763,7 @@ def write(self, **kwargs):
37633763
class LegacyTable(Table):
37643764

37653765
""" an appendable table: allow append/query/delete operations to a
3766-
(possibily) already existing appendable table this table ALLOWS
3766+
(possibly) already existing appendable table this table ALLOWS
37673767
append (but doesn't require them), and stores the data in a format
37683768
that can be easily searched
37693769

pandas/tests/categorical/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def test_constructor_from_categorical_with_unknown_dtype(self):
382382
ordered=True)
383383
tm.assert_categorical_equal(result, expected)
384384

385-
def test_contructor_from_categorical_string(self):
385+
def test_constructor_from_categorical_string(self):
386386
values = Categorical(['a', 'b', 'd'])
387387
# use categories, ordered
388388
result = Categorical(values, categories=['a', 'b', 'c'], ordered=True,

pandas/tests/frame/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def test_nested_dict_frame_constructor(self):
543543
tm.assert_frame_equal(result, df)
544544

545545
def _check_basic_constructor(self, empty):
546-
# mat: 2d matrix with shpae (3, 2) to input. empty - makes sized
546+
# mat: 2d matrix with shape (3, 2) to input. empty - makes sized
547547
# objects
548548
mat = empty((2, 3), dtype=float)
549549
# 2-D input

pandas/tests/io/formats/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ def test_date_tz(self):
25312531
[datetime(2013, 1, 1), pd.NaT], utc=True).format()
25322532
assert formatted[0] == "2013-01-01 00:00:00+00:00"
25332533

2534-
def test_date_explict_date_format(self):
2534+
def test_date_explicit_date_format(self):
25352535
formatted = pd.to_datetime([datetime(2003, 2, 1), pd.NaT]).format(
25362536
date_format="%m-%d-%Y", na_rep="UT")
25372537
assert formatted[0] == "02-01-2003"

pandas/tests/series/test_analytics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_empty(self, method, unit, use_bottleneck):
4343
result = getattr(s, method)()
4444
assert result == unit
4545

46-
# Explict
46+
# Explicit
4747
result = getattr(s, method)(min_count=0)
4848
assert result == unit
4949

pandas/tests/series/test_operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ def test_timedelta_floordiv(self, scalar_td):
11631163
('NCC1701D', 'NCC1701D', 'NCC1701D')])
11641164
def test_td64_series_with_tdi(self, names):
11651165
# GH#17250 make sure result dtype is correct
1166-
# GH#19043 make sure names are propogated correctly
1166+
# GH#19043 make sure names are propagated correctly
11671167
tdi = pd.TimedeltaIndex(['0 days', '1 day'], name=names[0])
11681168
ser = Series([Timedelta(hours=3), Timedelta(hours=4)], name=names[1])
11691169
expected = Series([Timedelta(hours=3), Timedelta(days=1, hours=4)],

pandas/tests/sparse/frame/test_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_constructor_from_unknown_type(self):
218218
class Unknown:
219219
pass
220220
with pytest.raises(TypeError,
221-
message='SparseDataFrame called with unkown type '
221+
message='SparseDataFrame called with unknown type '
222222
'"Unknown" for data argument'):
223223
SparseDataFrame(Unknown())
224224

pandas/util/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ class for all warnings. To check that no warning is returned,
24012401
into errors.
24022402
Valid values are:
24032403
2404-
* "error" - turns matching warnings into exeptions
2404+
* "error" - turns matching warnings into exceptions
24052405
* "ignore" - discard the warning
24062406
* "always" - always emit a warning
24072407
* "default" - print the warning the first time it is generated

0 commit comments

Comments
 (0)