MCPcopy
hub / github.com/pandas-dev/pandas / MergeError

Class MergeError

pandas/errors/__init__.py:435–463  ·  view source on GitHub ↗

Exception raised when merging data. Subclass of ``ValueError``. See Also -------- DataFrame.join : For joining DataFrames on their indexes. merge : For merging two DataFrames on a common set of keys. Examples -------- >>> left = pd.DataFrame( ... {"a":

Source from the content-addressed store, hash-verified

433
434
435class MergeError(ValueError):
436 """
437 Exception raised when merging data.
438
439 Subclass of ``ValueError``.
440
441 See Also
442 --------
443 DataFrame.join : For joining DataFrames on their indexes.
444 merge : For merging two DataFrames on a common set of keys.
445
446 Examples
447 --------
448 >>> left = pd.DataFrame(
449 ... {"a": ["a", "b", "b", "d"], "b": ["cat", "dog", "weasel", "horse"]},
450 ... index=range(4),
451 ... )
452 >>> right = pd.DataFrame(
453 ... {"a": ["a", "b", "c", "d"], "c": ["meow", "bark", "chirp", "nay"]},
454 ... index=range(4),
455 ... ).set_index("a")
456 >>> left.join(
457 ... right,
458 ... on="a",
459 ... validate="one_to_one",
460 ... )
461 Traceback (most recent call last):
462 MergeError: Merge keys are not unique in left dataset; not a one-to-one merge
463 """
464
465
466class AbstractMethodError(NotImplementedError):

Callers 9

_cross_mergeFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
_check_dtype_matchMethod · 0.90
_validate_toleranceMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected