is now LinkedIn Learning!

To access courses again, please join LinkedIn Learning

All the same content you know and love

Plus, personalized course recommendations tailored just for you

All the same access to your Lynda learning history and certifications

Try LinkedIn Learning for free
Questions? Visit our help center.

How does my subscription work?

Can I use a different payment method?

Yes, after you upgrade to LinkedIn Learning you can change your payment method on

Upgrade Now

By upgrading, your account will only be accessible on Linkedin Learning.

Skip navigation

Python: Data Analysis (2015)

Welcome: Python: Data Analysis (2015)
Welcome: Python: Data Analysis (2015)
Skill Level Intermediate
2h 16m
Show More Show Less
Resume Transcript Auto-Scroll

Q: The course shows how to download files from FTP and web servers using Python 3.X. How do I do the same thing with Python 2.7?

A: First import urllib, then use urllib.urlretrieve(URL,filename). For instance, to download the stations.txt files used in the chapter 5 video “Downloading and parsing data files,” you’d do urllib.urlretrieve(‘','stations.txt').

Q. What are the issues with DataFrame.sort()?

A: Since Pandas version 0.18, the DataFrame method sort() was removed in favor of sort_values(). Unlike sort(), the new method does not sort records in place unless it is given the option "inplace=True". The following lines of code in the video need changing:?

  • In Chapter 6: Introduction to Pandas/DataFrames in iPandas
    • twoyears = twoyears.sort('2015',ascending=False) -> twoyears = twoyears.sort_values('2015',ascending=False)

  • In Chapter 7: Baby names with Pandas/A yearly top ten
    • allyears_indexed.loc['M',:,2008].sort_values('number',ascending=False).head()
    • pop2008 = allyears_indexed.loc['M',:,2008].sort_values('number',ascending=False).head()
    • def topten(sex,year):
      • simple = allyears_indexed.loc[sex,:,year].sort_values('number',ascending=False).reset_index()

  • In Chapter 7: Baby names with Pandas/Name Fads
    • [in addition to lines above, which are used to initialize the "name fads" computation]
    • spiky_common = spiky_common.sort_values(ascending=False)
    • spiky_common = spiky_common.sort_values(ascending=False); spiky_common.head(10)

  • In Chapter 7: Baby names with Pandas/Solution
    • [in addition to lines above, which are used to initialize the "name fads" computation]
    • totals_both = totals_both.sort_values(ascending=False)

Q. What are the issues with Pandas categorical data?

A. Since version 0.6, seaborn.load_dataset converts certain columns to Pandas categorical data (see? This creates a problem in the handling of the "flights" DataFrame used in "Introduction to Pandas/Using multilevel indices". To avoid the problem, you may load the dataset directly with Pandas:


Q.?What are the issues with matplotlib.pyplot.stackplot? ?

A.?In recent versions of matplotlib, the function matplotlib.pyplot.stackplot now throws an error if given the keyword argument "label". This problem occurs in the "Baby names with Pandas/Name popularity" exercise file, and it can be ignored. In the video, matplotlib does not complain, but nevertheless shows no legend for the plot. The tutorial moves on to show how to make a legend using matplotlib.pyplot.text.

Skills covered in this course
Big Data Developer IT Programming Languages pandas NumPy Python

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start My Free Month

Start your free month on LinkedIn Learning, which now features 100% of courses. Develop in-demand skills with access to thousands of expert-led courses on business, tech and creative topics.

Start My Free Month

You are now leaving and will be automatically redirected to LinkedIn Learning to access your learning content.