Skip to content

Correct some typos in the repository #52254

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

Merged
merged 1 commit into from
Mar 28, 2023
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/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ Data sets do not only contain numerical data. pandas provides a wide range of fu
Coming from...
--------------

Are you familiar with other software for manipulating tablular data? Learn
Are you familiar with other software for manipulating tabular data? Learn
the pandas-equivalent operations compared to software you already know:

.. panels::
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ As usual, **both sides** of the slicers are included as this is label indexing.
.. warning::

You should specify all axes in the ``.loc`` specifier, meaning the indexer for the **index** and
for the **columns**. There are some ambiguous cases where the passed indexer could be mis-interpreted
for the **columns**. There are some ambiguous cases where the passed indexer could be misinterpreted
  as indexing *both* axes, rather than into say the ``MultiIndex`` for the rows.

You should do this:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ the columns except the one we specify:
grouped.sum()

The above GroupBy will split the DataFrame on its index (rows). To split by columns, first do
a tranpose:
a transpose:

.. ipython::

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ def validate_func_kwargs(
Returns
-------
columns : List[str]
List of user-provied keys.
List of user-provided keys.
func : List[Union[str, callable[...,Any]]]
List of user-provided aggfuncs

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,13 @@ def register_converter_cb(key) -> None:
styler_max_rows = """
: int, optional
The maximum number of rows that will be rendered. May still be reduced to
satsify ``max_elements``, which takes precedence.
satisfy ``max_elements``, which takes precedence.
"""

styler_max_columns = """
: int, optional
The maximum number of columns that will be rendered. May still be reduced to
satsify ``max_elements``, which takes precedence.
satisfy ``max_elements``, which takes precedence.
"""

styler_precision = """
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ def pandas_dtype(dtype) -> DtypeObj:
try:
with warnings.catch_warnings():
# GH#51523 - Series.astype(np.integer) doesn't show
# numpy deprication warning of np.integer
# numpy deprecation warning of np.integer
# Hence enabling DeprecationWarning
warnings.simplefilter("always", DeprecationWarning)
npdtype = np.dtype(dtype)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def _parse_dtype_strict(cls, freq: str_type) -> BaseOffset:
return freq_offset

raise TypeError(
"PeriodDtype argument should be string or BaseOffet, "
"PeriodDtype argument should be string or BaseOffset, "
f"got {type(freq).__name__}"
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6559,7 +6559,7 @@ def infer_objects(self, copy: bool_t | None = None) -> Self:
Parameters
----------
copy : bool, default True
Whether to make a copy for non-object or non-inferrable columns
Whether to make a copy for non-object or non-inferable columns
or Series.

Returns
Expand Down
6 changes: 3 additions & 3 deletions pandas/io/excel/_pyxlsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_sheet_data(
file_rows_needed: int | None = None,
) -> list[list[Scalar]]:
data: list[list[Scalar]] = []
prevous_row_number = -1
previous_row_number = -1
# When sparse=True the rows can have different lengths and empty rows are
# not returned. The cells are namedtuples of row, col, value (r, c, v).
for row in sheet.rows(sparse=True):
Expand All @@ -99,9 +99,9 @@ def get_sheet_data(
# trim trailing empty elements
converted_row.pop()
if converted_row:
data.extend([[]] * (row_number - prevous_row_number - 1))
data.extend([[]] * (row_number - previous_row_number - 1))
data.append(converted_row)
prevous_row_number = row_number
previous_row_number = row_number
if file_rows_needed is not None and len(data) >= file_rows_needed:
break
if data:
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def _calc_max_rows_fitted(self) -> int | None:
_, height = get_terminal_size()
if self.max_rows == 0:
# rows available to fill with actual data
return height - self._get_number_of_auxillary_rows()
return height - self._get_number_of_auxiliary_rows()

if self._is_screen_short(height):
max_rows = height
Expand Down Expand Up @@ -775,7 +775,7 @@ def _is_screen_narrow(self, max_width) -> bool:
def _is_screen_short(self, max_height) -> bool:
return bool(self.max_rows == 0 and len(self.frame) > max_height)

def _get_number_of_auxillary_rows(self) -> int:
def _get_number_of_auxiliary_rows(self) -> int:
"""Get number of rows occupied by prompt, dots and dimension info."""
dot_row = 1
prompt_row = 1
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/arrays/categorical/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def test_comparisons(self, factor):
cat_rev > cat_rev_base2

# Only categories with same ordering information can be compared
cat_unorderd = cat.set_ordered(False)
cat_unordered = cat.set_ordered(False)
assert not (cat > cat).any()

with pytest.raises(TypeError, match=msg):
cat > cat_unorderd
cat > cat_unordered

# comparison (in both directions) with Series will raise
s = Series(["b", "b", "b"])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/dtypes/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def test_freq_argument_required(self):
with pytest.raises(TypeError, match=msg):
PeriodDtype()

msg = "PeriodDtype argument should be string or BaseOffet, got NoneType"
msg = "PeriodDtype argument should be string or BaseOffset, got NoneType"
with pytest.raises(TypeError, match=msg):
# GH#51790
PeriodDtype(None)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/methods/test_isetitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_isetitem_ea_df_scalar_indexer(self):
)
tm.assert_frame_equal(df, expected)

def test_isetitem_dimension_missmatch(self):
def test_isetitem_dimension_mismatch(self):
# GH#51701
df = DataFrame({"a": [1, 2], "b": [3, 4], "c": [5, 6]})
value = df.copy()
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ def test_inplace_arithmetic_series_update(using_copy_on_write):
tm.assert_frame_equal(df, expected)


def test_arithemetic_multiindex_align():
def test_arithmetic_multiindex_align():
"""
Regression test for: https://github.com/pandas-dev/pandas/issues/33765
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_npfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class TestAsArray:
def test_asarray_homogenous(self):
def test_asarray_homogeneous(self):
df = DataFrame({"A": Categorical([1, 2]), "B": Categorical([1, 2])})
result = np.asarray(df)
# may change from object in the future
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_unary.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_invert_mixed(self):
)
tm.assert_frame_equal(result, expected)

def test_invert_empy_not_input(self):
def test_invert_empty_not_input(self):
# GH#51032
df = pd.DataFrame()
result = ~df
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/groupby/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,12 @@ def test_filter_non_bool_raises():
def test_filter_dropna_with_empty_groups():
# GH 10780
data = Series(np.random.rand(9), index=np.repeat([1, 2, 3], 3))
groupped = data.groupby(level=0)
result_false = groupped.filter(lambda x: x.mean() > 1, dropna=False)
grouped = data.groupby(level=0)
result_false = grouped.filter(lambda x: x.mean() > 1, dropna=False)
expected_false = Series([np.nan] * 9, index=np.repeat([1, 2, 3], 3))
tm.assert_series_equal(result_false, expected_false)

result_true = groupped.filter(lambda x: x.mean() > 1, dropna=True)
result_true = grouped.filter(lambda x: x.mean() > 1, dropna=True)
expected_true = Series(index=pd.Index([], dtype=int), dtype=np.float64)
tm.assert_series_equal(result_true, expected_true)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/json/test_readlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def test_readjson_nrows_chunks(request, nrows, chunksize, engine):

def test_readjson_nrows_requires_lines(engine):
# GH 33916
# Test ValuError raised if nrows is set without setting lines in read_json
# Test ValueError raised if nrows is set without setting lines in read_json
jsonl = """{"a": 1, "b": 2}
{"a": 3, "b": 4}
{"a": 5, "b": 6}
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/resample/test_resample_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,12 +983,12 @@ def test_df_axis_param_depr():
index.name = "date"
df = DataFrame(np.random.rand(10, 2), columns=list("AB"), index=index).T

# Deprication error when axis=1 is explicitly passed
# Deprecation error when axis=1 is explicitly passed
warning_msg = "DataFrame.resample with axis=1 is deprecated."
with tm.assert_produces_warning(FutureWarning, match=warning_msg):
df.resample("M", axis=1)

# Deprication error when axis=0 is explicitly passed
# Deprecation error when axis=0 is explicitly passed
df = df.T
warning_msg = (
"The 'axis' keyword in DataFrame.resample is deprecated and "
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/reshape/concat/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def test_concat_mixed_objs(self):
result = concat([s1, df, s2], ignore_index=True)
tm.assert_frame_equal(result, expected)

def test_dtype_coerceion(self):
def test_dtype_coercion(self):
# 12411
df = DataFrame({"date": [pd.Timestamp("20130101").tz_localize("UTC"), pd.NaT]})

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/scalar/timestamp/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def test_constructor_fromisocalendar(self):
assert isinstance(result, Timestamp)


def test_constructor_ambigous_dst():
def test_constructor_ambiguous_dst():
# GH 24329
# Make sure that calling Timestamp constructor
# on Timestamp created from ambiguous time
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/scalar/timestamp/test_unary_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class TestTimestampUnaryOps:
# --------------------------------------------------------------
def test_round_divison_by_zero_raises(self):
def test_round_division_by_zero_raises(self):
ts = Timestamp("2016-01-01")

msg = "Division by zero in rounding"
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/indexing/test_getitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_getitem_dataframe_raises():
ser[df > 5]


def test_getitem_assignment_series_aligment():
def test_getitem_assignment_series_alignment():
# https://github.com/pandas-dev/pandas/issues/37427
# with getitem, when assigning with a Series, it is not first aligned
ser = Series(range(10))
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/methods/test_sort_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_sort_values_ignore_index(
tm.assert_series_equal(result_ser, expected)
tm.assert_series_equal(ser, Series(original_list))

def test_mergesort_decending_stability(self):
def test_mergesort_descending_stability(self):
# GH 28697
s = Series([1, 2, 1, 3], ["first", "b", "second", "c"])
result = s.sort_values(ascending=False, kind="mergesort")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_infer_with_date_and_datetime(self):
expected = Index(vals, dtype=object)
tm.assert_index_equal(idx, expected)

def test_unparseable_strings_with_dt64_dtype(self):
def test_unparsable_strings_with_dt64_dtype(self):
# pre-2.0 these would be silently ignored and come back with object dtype
vals = ["aa"]
msg = "^Unknown datetime string format, unable to parse: aa, at position 0$"
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/util/test_assert_index_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_index_equal_values_too_far(check_exact, rtol):


@pytest.mark.parametrize("check_order", [True, False])
def test_index_equal_value_oder_mismatch(check_exact, rtol, check_order):
def test_index_equal_value_order_mismatch(check_exact, rtol, check_order):
idx1 = Index([1, 2, 3])
idx2 = Index([3, 2, 1])

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ ignore = [
"B904",
# Magic number
"PLR2004",
# Consider `elif` instead of `else` then `if` to remove indendation level
# Consider `elif` instead of `else` then `if` to remove indentation level
"PLR5501",
]

Expand Down