Skip to content
Open
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/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ on_bad_lines : {{'error', 'warn', 'skip'}}, default 'error'
Specifies what to do upon encountering a bad line (a line with too many fields).
Allowed values are :

- 'error', raise an ParserError when a bad line is encountered.
- 'error', raise a ParserError when a bad line is encountered.
- 'warn', print a warning when a bad line is encountered and skip that line.
- 'skip', skip bad lines without raising or warning when they are encountered.

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,7 @@ def maybe_convert_objects(ndarray[object] objects,
Whether to convert numeric entries.
convert_to_nullable_dtype : bool, default False
If an array-like object contains only integer or boolean values (and NaN) is
encountered, whether to convert and return an Boolean/IntegerArray.
encountered, whether to convert and return a Boolean/IntegerArray.
convert_non_numeric : bool, default False
Whether to convert datetime, timedelta, period, interval types.
dtype_if_all_nat : np.dtype, ExtensionDtype, or None, default None
Expand Down
10 changes: 5 additions & 5 deletions pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_date_name_field(
NPY_DATETIMEUNIT reso=NPY_FR_ns,
):
"""
Given a int64-based datetime index, return array of strings of date
Given an int64-based datetime index, return array of strings of date
name based on requested field (e.g. day_name)
"""
cdef:
Expand Down Expand Up @@ -335,7 +335,7 @@ def get_date_field(
NPY_DATETIMEUNIT reso=NPY_FR_ns,
):
"""
Given a int64-based datetime index, extract the year, month, etc.,
Given an int64-based datetime index, extract the year, month, etc.,
field and return an array of these values.
"""
cdef:
Expand Down Expand Up @@ -502,7 +502,7 @@ def get_timedelta_field(
NPY_DATETIMEUNIT reso=NPY_FR_ns,
):
"""
Given a int64-based timedelta index, extract the days, hrs, sec.,
Given an int64-based timedelta index, extract the days, hrs, sec.,
field and return an array of these values.
"""
cdef:
Expand Down Expand Up @@ -555,7 +555,7 @@ def get_timedelta_days(
NPY_DATETIMEUNIT reso=NPY_FR_ns,
):
"""
Given a int64-based timedelta index, extract the days,
Given an int64-based timedelta index, extract the days,
field and return an array of these values.
"""
cdef:
Expand Down Expand Up @@ -592,7 +592,7 @@ cpdef isleapyear_arr(ndarray years):
@cython.boundscheck(False)
def build_isocalendar_sarray(const int64_t[:] dtindex, NPY_DATETIMEUNIT reso):
"""
Given a int64-based datetime array, return the ISO 8601 year, week, and day
Given an int64-based datetime array, return the ISO 8601 year, week, and day
as a structured array.
"""
cdef:
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ cdef class BaseOffset:
@property
def nanos(self):
"""
Returns a integer of the total number of nanoseconds for fixed frequencies.
Returns an integer of the total number of nanoseconds for fixed frequencies.

Raises
------
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 @@ -334,7 +334,7 @@ cdef convert_to_timedelta64(object ts, str unit):
Handle these types of objects:
- timedelta/Timedelta

Return an timedelta64[ns] object
Return a timedelta64[ns] object
"""
# Caller is responsible for checking unit not in ["Y", "y", "M"]
if isinstance(ts, _Timedelta):
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ cdef class _Timestamp(ABCTimestamp):

def to_period(self, freq=None):
"""
Return an period of which this timestamp is an observation.
Return a period of which this timestamp is an observation.

This method converts the given Timestamp to a Period object,
which represents a span of time,such as a year, month, etc.,
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class BooleanArray(BaseMaskedArray):
BooleanArray implements Kleene logic (sometimes called three-value
logic) for logical operations. See :ref:`boolean.kleene` for more.

To construct an BooleanArray from generic array-like input, use
To construct a BooleanArray from generic array-like input, use
:func:`pandas.array` specifying ``dtype="boolean"`` (see examples
below).

Expand Down Expand Up @@ -313,7 +313,7 @@ class BooleanArray(BaseMaskedArray):

Examples
--------
Create an BooleanArray with :func:`pandas.array`:
Create a BooleanArray with :func:`pandas.array`:

>>> pd.array([True, False, None], dtype="boolean")
<BooleanArray>
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ def to_period(self, freq=None) -> PeriodArray:
----------
freq : str or Period, optional
One of pandas' :ref:`period aliases <timeseries.period_aliases>`
or an Period object. Will be inferred by default.
or a Period object. Will be inferred by default.

Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/floating.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class FloatingArray(NumericArray):
- data: contains a numpy float array of the appropriate dtype
- mask: a boolean array holding a mask on the data, True is missing

To construct an FloatingArray from generic array-like input, use
To construct a FloatingArray from generic array-like input, use
:func:`pandas.array` with one of the float dtypes (see examples).

See :ref:`integer_na` for more.
Expand Down Expand Up @@ -114,7 +114,7 @@ class FloatingArray(NumericArray):

Examples
--------
Create an FloatingArray with :func:`pandas.array`:
Create a FloatingArray with :func:`pandas.array`:

>>> pd.array([0.1, None, 0.3], dtype=pd.Float32Dtype())
<FloatingArray>
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ def nunique(self, dropna: bool = True) -> int:
Returns
-------
int
A integer indicating the number of unique elements in the object.
An integer indicating the number of unique elements in the object.

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _astype_float_to_int_nansafe(
values: np.ndarray, dtype: np.dtype, copy: bool
) -> np.ndarray:
"""
astype with a check preventing converting NaN to an meaningless integer value.
astype with a check preventing converting NaN to a meaningless integer value.
"""
if not np.isfinite(values).all():
raise IntCastingNaNError(
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 @@ -1387,7 +1387,7 @@ def construct_from_string(cls, string: str_type) -> IntervalDtype:
return cls(string)

msg = (
f"Cannot construct a 'IntervalDtype' from '{string}'.\n\n"
f"Cannot construct an 'IntervalDtype' from '{string}'.\n\n"
"Incorrectly formatted string passed to constructor. "
"Valid formats include Interval or Interval[dtype] "
"where dtype is numeric, datetime, or timedelta"
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2868,7 +2868,7 @@ def drop_duplicates(self, *, keep: DropKeep = "first") -> Self:

Examples
--------
Generate an pandas.Index with duplicate values.
Generate a pandas.Index with duplicate values.

>>> idx = pd.Index(["llama", "cow", "llama", "beetle", "llama", "hippo"])

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def inherit_names(
names: list[str], delegate: type, cache: bool = False, wrap: bool = False
) -> Callable[[type[_ExtensionIndexT]], type[_ExtensionIndexT]]:
"""
Class decorator to pin attributes from an ExtensionArray to a Index subclass.
Class decorator to pin attributes from an ExtensionArray to an Index subclass.

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/util/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def hash_tuples(
hash_key: str = _default_hash_key,
) -> npt.NDArray[np.uint64]:
"""
Hash an MultiIndex / listlike-of-tuples efficiently.
Hash a MultiIndex / listlike-of-tuples efficiently.

Parameters
----------
Expand Down Expand Up @@ -261,7 +261,7 @@ def hash_array(
See Also
--------
util.hash_pandas_object : Return a data hash of the Index/Series/DataFrame.
util.hash_tuples : Hash an MultiIndex / listlike-of-tuples efficiently.
util.hash_tuples : Hash a MultiIndex / listlike-of-tuples efficiently.

Examples
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/excel/_xlsxwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def convert(cls, style_dict, num_format_str=None) -> dict[str, Any]:
style_dict : style dictionary to convert
num_format_str : optional number format string
"""
# Create a XlsxWriter format object.
# Create an XlsxWriter format object.
props = {}

if num_format_str is not None:
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/parsers/python_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ def _infer_columns(
this_columns[i] = col
counts[col] = cur_count + 1
elif have_mi_columns:
# if we have grabbed an extra line, but its not in our
# format so save in the buffer, and create an blank extra
# if we have grabbed an extra line, but it's not in our
# format so save in the buffer, and create a blank extra
# line for the rest of the parsing code
if hr == header[-1]:
lc = len(this_columns)
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4999,7 +4999,7 @@ def indexables(self):

# error: Signature of "write" incompatible with supertype "AppendableTable"
def write(self, **kwargs) -> None: # type: ignore[override]
raise NotImplementedError("cannot write on an generic table")
raise NotImplementedError("cannot write on a generic table")


class AppendableMultiFrameTable(AppendableFrameTable):
Expand Down Expand Up @@ -5371,7 +5371,7 @@ def _need_convert(kind: str) -> bool:

def _maybe_adjust_name(name: str, version: Sequence[int]) -> str:
"""
Prior to 0.10.1, we named values blocks like: values_block_0 an the
Prior to 0.10.1, we named values blocks like: values_block_0 and the
name values_0, adjust the given name if necessary.

Parameters
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/generic/test_label_or_level_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def test_is_level_reference_df_ambig(df_ambig, axis):
assert_label_reference(df_ambig, ["L1"], axis=axis)

# df has an on-axis level named L2 and it is not ambiguous
# Therefore L2 is an level reference
# Therefore L2 is a level reference
assert_level_reference(df_ambig, ["L2"], axis=axis)

# df has a column named L3 and it not an level reference
# df has a column named L3 and it is not a level reference
assert_label_reference(df_ambig, ["L3"], axis=axis)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/period/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_base_constructor_with_period_dtype(self):
"values_constructor", [list, np.array, PeriodIndex, PeriodArray._from_sequence]
)
def test_index_object_dtype(self, values_constructor):
# Index(periods, dtype=object) is an Index (not an PeriodIndex)
# Index(periods, dtype=object) is an Index (not a PeriodIndex)
periods = [
Period("2011-01", freq="M"),
NaT,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/excel/test_odf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_read_invalid_types_raises():


def test_read_writer_table():
# Also test reading tables from an text OpenDocument file
# Also test reading tables from a text OpenDocument file
# (.odt)
index = pd.Index(["Row 1", "Row 2", "Row 3"], name="Header")
expected = pd.DataFrame(
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/strings/test_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def test_extractall_same_as_extract(any_string_dtype):


def test_extractall_same_as_extract_subject_index(any_string_dtype):
# same as above tests, but s has an MultiIndex.
# same as above tests, but s has a MultiIndex.
mi = MultiIndex.from_tuples(
[("A", "first"), ("B", "second"), ("C", "third")],
names=("capital", "ordinal"),
Expand Down
Loading