Testing

Assertion functions

testing.assert_frame_equal(left, right[, ...])

Check that left and right DataFrame are equal.

testing.assert_series_equal(left, right[, ...])

Check that left and right Series are equal.

testing.assert_index_equal(left, right[, ...])

Check that left and right Index are equal.

testing.assert_extension_array_equal(left, right)

Check that left and right ExtensionArrays are equal.

Exceptions and warnings

errors.AbstractMethodError(class_instance[, ...])

Raise this error instead of NotImplementedError for abstract methods while keeping compatibility with Python 2 and Python 3.

errors.AccessorRegistrationWarning

Warning for attribute conflicts in accessor registration.

errors.DataError

Exception raised when trying to perform a ohlc on a non-numnerical column.

errors.DtypeWarning

Warning raised when reading different dtypes in a column from a file.

errors.DuplicateLabelError

Error raised when an operation would introduce duplicate labels.

errors.EmptyDataError

Exception that is thrown in pd.read_csv (by both the C and Python engines) when empty data or header is encountered.

errors.IndexingError

Exception is raised when trying to index and there is a mismatch in dimensions.

errors.InvalidIndexError

Exception raised when attempting to use an invalid index key.

errors.IntCastingNaNError

Raised when attempting an astype operation on an array with NaN to an integer dtype.

errors.MergeError

Error raised when problems arise during merging due to problems with input data.

errors.NullFrequencyError

Error raised when a null freq attribute is used in an operation that needs a non-null frequency, particularly DatetimeIndex.shift, TimedeltaIndex.shift, PeriodIndex.shift.

errors.NumbaUtilError

Error raised for unsupported Numba engine routines.

errors.NumExprClobberingError

Exception is raised when trying to use a built-in numexpr name as a variable name in a method like query or eval.

errors.OptionError

Exception for pandas.options, backwards compatible with KeyError checks.

errors.OutOfBoundsDatetime

Raised when the datetime is outside the range that can be represented.

errors.OutOfBoundsTimedelta

Raised when encountering a timedelta value that cannot be represented as a timedelta64[ns].

errors.ParserError

Exception that is raised by an error encountered in parsing file contents.

errors.ParserWarning

Warning raised when reading a file that doesn't use the default 'c' parser.

errors.PerformanceWarning

Warning raised when there is a possible performance impact.

errors.PyperclipException

Exception is raised when trying to use methods like to_clipboard() and read_clipboard() on an unsupported OS/platform.

errors.PyperclipWindowsException(message)

Exception is raised when pandas is unable to get access to the clipboard handle due to some other window process is accessing it.

errors.SettingWithCopyError

Exception is raised when trying to set on a copied slice from a dataframe and the mode.chained_assignment is set to 'raise.' This can happen unintentionally when chained indexing.

errors.SettingWithCopyWarning

Warning is raised when trying to set on a copied slice from a dataframe and the mode.chained_assignment is set to 'warn.' 'Warn' is the default option.

errors.SpecificationError

Exception raised in two scenarios.

errors.UndefinedVariableError(name[, is_local])

Exception is raised when trying to use an undefined variable name in a method like query or eval.

errors.UnsortedIndexError

Error raised when attempting to get a slice of a MultiIndex, and the index has not been lexsorted.

errors.UnsupportedFunctionCall

Exception raised when attempting to call a numpy function on a pandas object, but that function is not supported by the object e.g.

Bug report function

show_versions([as_json])

Provide useful information, important for bug reports.

Test suite runner

test([extra_args])

Run the pandas test suite using pytest.