0

i have this old DataFrame:

Énergie(keV) Intensité(%) Type Parent Période Unité
13.31275 2.18 XL Fr-221 4.79 min
78.94000 0.96 XKα2 Fr-221 4.79 min
81.51000 1.59 XKα1 Fr-221 4.79 min
92.30930 0.55 XKβ1 Fr-221 4.79 min

i want update the 3 first columns with;

Énergie(keV) Intensité(%) Type Parent
13.31275 18 γ Fr-221
75.94000 25 γ Fr-221
89.51000 1.09 XKα1 Fr-221
99.00000 0.85 γ Fr-221

I have a big dataframe , but they havn't a same dimensions;

Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91
  • By what logic should be the two dataframes merged? – Andrej Kesely Jun 20 '21 at 17:48
  • I think something like ```old_df[['col1','col2','col3']] = new_df[['col1','col2','col3']]``` – Kabilan Mohanraj Jun 20 '21 at 18:04
  • 1
    Hi. Is this what you're looking for? [https://stackoverflow.com/questions/24768657/replace-column-values-based-on-another-dataframe-python-pandas-better-way](https://stackoverflow.com/questions/24768657/replace-column-values-based-on-another-dataframe-python-pandas-better-way) – Kabilan Mohanraj Jun 21 '21 at 05:39

1 Answers1

0

it look like this the old one:
|Énergie(keV)| Intensité(%)| Type | Parent | Période| Unité| |:-----------|:------------:|:-------:|:------:|:---------:|:-------:| |0.381 |0.019 |XL |Sc-44 |3.97 |h | |10.408 |0.45 |XL |Ti-44 |60.0 |a | |0.430 |0.00013 |XL |Fr-221 |83.788 |d |

the forth row mus be updated from the new dataframe