Aan de slagGa gratis aan de slag

Accessing using names

In this exercise, you will access data that tracks an account over time. This account consists of wealth from both cash and equities. The data is supplied in a DataFrame named ledger with the index set to dates, represented as strings. The data looks like this:

Cash Securities Balance
2020-10-01 0.0 -300.0 1222.0
2020-10-02 300.0 -200.0 1322.0
2020-10-03 -100.0 700.0 1922.0

Deze oefening maakt deel uit van de cursus

Intermediate Python for Finance

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Select the Balance for October 2nd
print(ledger.loc['____','____'])

# Select the Balance for October 3rd
print(ledger.____['____','____'])
Code bewerken en uitvoeren