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

Method update

pandas/core/frame.py:10441–10606  ·  view source on GitHub ↗

Modify in place using non-NA values from another DataFrame. Aligns on indices. There is no return value. Parameters ---------- other : DataFrame, or object coercible into a DataFrame Should have at least one matching index/column label

(
        self,
        other,
        join: UpdateJoin = "left",
        overwrite: bool = True,
        filter_func=None,
        errors: IgnoreRaise = "ignore",
    )

Source from the content-addressed store, hash-verified

10439 return combined.__finalize__(self, method="combine_first")
10440
10441 def update(
10442 self,
10443 other,
10444 join: UpdateJoin = "left",
10445 overwrite: bool = True,
10446 filter_func=None,
10447 errors: IgnoreRaise = "ignore",
10448 ) -> None:
10449 """
10450 Modify in place using non-NA values from another DataFrame.
10451
10452 Aligns on indices. There is no return value.
10453
10454 Parameters
10455 ----------
10456 other : DataFrame, or object coercible into a DataFrame
10457 Should have at least one matching index/column label
10458 with the original DataFrame. If a Series is passed,
10459 its name attribute must be set, and that will be
10460 used as the column name to align with the original DataFrame.
10461 join : {'left'}, default 'left'
10462 Only left join is implemented, keeping the index and columns of the
10463 original object.
10464 overwrite : bool, default True
10465 How to handle non-NA values for overlapping keys:
10466
10467 * True: overwrite original DataFrame's values
10468 with values from `other`.
10469 * False: only update values that are NA in
10470 the original DataFrame.
10471
10472 filter_func : callable(1d-array) -> bool 1d-array, optional
10473 Can choose to replace values other than NA. Return True for values
10474 that should be updated.
10475 errors : {'raise', 'ignore'}, default 'ignore'
10476 If 'raise', will raise a ValueError if the DataFrame and `other`
10477 both contain non-NA data in the same place.
10478
10479 Returns
10480 -------
10481 None
10482 This method directly changes calling object.
10483
10484 Raises
10485 ------
10486 ValueError
10487 * When `errors='raise'` and there's overlapping non-NA data.
10488 * When `errors` is not either `'ignore'` or `'raise'`
10489 NotImplementedError
10490 * If `join != 'left'`
10491
10492 See Also
10493 --------
10494 dict.update : Similar method for dictionaries.
10495 DataFrame.merge : For column(s)-on-column(s) operations.
10496
10497 Notes
10498 -----

Calls 7

reindexMethod · 0.95
isnaFunction · 0.90
notnaFunction · 0.90
intersectionMethod · 0.80
DataFrameClass · 0.70
allMethod · 0.45
whereMethod · 0.45