1
Good evening everyone, all right? I’m new to Python and I was doing some exercises where I needed to select some information from a database. In one of the subitens, the correct code was:
halftime_musicians[halftime_musicians.super_bowl <= 27]
The next, the correct code was:
# Display musicians with more than one halftime show appearance
halftime_appearances[haltime_appearances['super_bowl'] <=2** ]
Because in the first case, to reference a Super Mouse column I used the coluna.super_bowl
and in the second case I had to use coluna['super_bowl']
instead of coluna.super_bowl
?
Just adding something useful to the topic, another option, and even more recommended is to use the query function, this way (for example): halftime_musicians.query('super_bowl <= 27')
– Pedro Costa