Aan de slagGa gratis aan de slag

Selecting columns

Unlike R, Python doesn't have a built-in data structure similar to data frames. The library pandas gives you access to DataFrames in Python.

In pandas, you can either use the dot (.) notation or the square bracket notation ([ ]) to select columns. However, if your column name has a space in it, or if the name clashes with a DataFrame attribute, then the convenient dot notation won't work.

Deze oefening maakt deel uit van de cursus

Python for R Users

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Print the tip column using dot notation
print(tips____)
Code bewerken en uitvoeren