Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | Python (34 exercises) |
Topic ==> | Overview of Pandas (3 exercises) |
Level ==> | Harder than average |
Subject ==> | Python training |
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
Load the most-watched Netflix series of all time at the time of writing (as given by Wikipedia) into a pandas dataframe.
Rename the last two columns as follows:
Old name | New name |
---|---|
Title | Series name |
Hours (millions) | Million hours |
Print out your dataframe - it should start something like this:
Proving that nothing sells better than violence and horror?
Now sort the series alphabetically by series name, and within each series in descending order of season/part number.
Use iloc to slice this new sorted dataframe, printing out just the first 2 columns:
The series sorted by name and number.
Use the iterrrows() method to loop over the rows of the dataframe, printing out only those whose genre contains the word Horror:
This should be the output from this part of the program.
Still too easy? Try filtering the dataframe to contain only those series whose titles contain the letter u:
Make sure your program picks up on all 3 of these!
The only way Wise Owl could find to do this using filtering was to take the series, convert it to a string, convert this to upper text, convert this to a string again (otherwise you're left with a series object) and then see if this contains the letter u. If you find an easier way - and you probably will - let your trainer know!
Save and close your program.
You can find other training resources for the subject of this exercise here:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.