Aan de slagGa gratis aan de slag

Accessing using indexes

In this exercise, you will select and set stock positions using the numerical indexes of the rows and columns in a DataFrame. The provided DataFrame has this data:

Symbol Purchased Quantity Price
0 AAPL 2016-01-08 23 96.96
1 AAPL 2018-09-07 50 221.30
2 AMZN 2020-02-14 14 324.95

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.

# Cell first row, Price column
print(positions.iloc[____, ____])

# Cell last row, Symbol column
print(positions.____[____, ____])
Code bewerken en uitvoeren