mardi 28 septembre 2021

Why i get the same value for all the different maturities?

DateFrame df that i got from webscraping :

  • Date d'échéance : due date
  • Transaction : Transaction
  • Taux moyen pondéré : weighted average rate
  • Date de la valeur : value date
  • maturite : maturity (calculated)

I should add column to my dataframe df called " Taux act" :

  • If Maturity 'maturite' > 1 YEAR : Taux act = weighted average rate 'Taux moyen pondéré'
  • If Maturity < 1 YEAR : Taux act = ((1 + weighted average rate maturity)/360)**(365/maturity)-1

Dataframe df : |Date d'échéance|Transaction|Taux moyen pondéré|Date de la valeur| maturite |taux | |---------------|-----------|------------------|-----------------|----------|----- | | 2019-04-14 | 104.47 | 2.300 | 2019-03-18 | 27 days |7.59..| |2019-05-20 | 71.28 | 2.333 | 2019-03-11 | 70 days |7.59..|

Aucun commentaire:

Enregistrer un commentaire