khan academy python data science

Last Updated on July 28, 2023

Introduction to Data Science in Python

This course will introduce the learner to the basics of the python programming environment, including fundamental python programming techniques such as lambdas, reading and manipulating csv files, and the numpy library. The course will introduce data manipulation and cleaning techniques using the popular python pandas data science library and introduce the abstraction of the Series and DataFrame as the central data structures for data analysis, along with tutorials on how to use functions such as groupby, merge, and pivot tables effectively. By the end of this course, students will be able to take tabular data, clean it, manipulate it, and run basic inferential statistical analyses.

This course should be taken before any of the other Applied Data Science with Python courses: Applied Plotting, Charting & Data Representation in Python, Applied Machine Learning in Python, Applied Text Mining in Python, Applied Social Network Analysis in Python.

Kickstart your learning of Python for data science, as well as programming in general, with this beginner-friendly introduction to Python. Python is one of the world’s most popular programming languages, and there has never been greater demand for professionals with the ability to apply Python fundamentals to drive business solutions across industries.

This course will take you from zero to programming in Python in a matter of hours—no prior programming experience necessary! You will learn Python fundamentals, including data structures and data analysis, complete hands-on exercises throughout the course modules, and create a final project to demonstrate your new skills. By the end of this course, you’ll feel comfortable creating basic programs, working with data, and solving real-world problems in Python. You’ll gain a strong foundation for more advanced learning in the field, and develop skills to help advance your career.

WHAT YOU WILL LEARN

  • Understand techniques such as lambdas and manipulating csv files
  • Describe common Python functionality and features used for data science
  • Query DataFrame structures for cleaning and processing
  • Explain distributions, sampling, and t-tests

Fundamentals of Data Manipulation with Python

In this week you’ll get an introduction to the field of data science, review common Python functionality and features which data scientists use, and be introduced to the Coursera Jupyter Notebook for the lectures. All of the course information on grading, prerequisites, and expectations are on the course syllabus, and you can find more information about the Jupyter Notebooks on our Course Resources page.

Basic Data Processing with Pandas

In this week of the course you’ll learn the fundamentals of one of the most important toolkits Python has for data cleaning and processing — pandas. You’ll learn how to read in data into DataFrame structures, how to query these structures, and the details about such structures are indexed.

More Data Processing with Pandas

In this week you’ll deepen your understanding of the python pandas library by learning how to merge DataFrames, generate summary tables, group data into logical pieces, and manipulate dates. We’ll also refresh your understanding of scales of data, and discuss issues with creating metrics for analysis. The week ends with a more significant programming assignment.

What is Python?

Python is one of the world’s most popular programming languages, and there are a few reasons why Python is so popular:

  • Python’s syntax, or the words and symbols used in order to make a computer program work, is simple and intuitive. They’re basically English words! 
  • Python supports various paradigms, but most people would describe Python as an object oriented-programming language. In an object-oriented programming language, everything you create is an object, different objects have different properties, and you can operate on different objects in different ways. 
  • Python integrates well with other software components, making it a general purpose language that can be used to build a full end-to-end pipeline – starting with data, cleaning a model, and building that straight into production. 

What can Python be used for besides data science? 

The better question is what can’t it be used for? Here are some key places where you may see Python:

  • Web Development – Developers, engineers, and data scientists use Python for web scraping or creating a mock-up an app.
  • Automating Reports – Analysts or product managers who need to make the same Excel report every single week can use Python to help create reports and save time. 
  • Finance and Business – Used for reporting, predictive models, and academic research. 
  • Simulations – As a postdoctoral fellow at Ohio State University, my colleagues used Python to create simulations to study various different behaviors with a computer.

Why do you think Python has recently overtaken R in popularity among data scientists?

There are a couple of reasons I think Python has taken off. Python is a general purpose language, used by data scientists and developers, which makes it easy to collaborate across your organization through its simple syntax. People choose to use Python so that they can communicate with other people. The other reason is rooted in academic research and statistical models. I would say that R has better statistical packages than Python, but Python has deep learning, structured ways to do machine learning, and can deal with larger amounts of data. As people shift more to deep learning, the bias has been shifting toward Python.

Python for Beginners

Python is an excellent first programming language for beginners because its simple syntax allows you to quickly hit the ground running. Python is flexible in that you can use it to do just about anything. It’s also forgiving! Python will try to interpret what you mean. Let’s say we wanted to add together two words like school and house. In our minds, we would link these two words by using the plus symbol (school + house) which is exactly how you would do it using Python! Python is also one of those languages that leaves plenty of room for growth and ways to improve your code. 

Within any field, you have to get the fundamentals of Python down first before you can move on to more interesting things. Here’s a list of fundamentals you can started with in order: 

  • Understand what data types are (integers, strings, floating point numbers) and how all of those data types are different. 
  • Learn loops and conditionals – Loops execute a block of code several times and conditionals tell the program when to stop executing that block of code. 
  • Learn how to manipulate data – Practice this by reading data into your Python program and then doing some kind of computations on it, cleaning it up, and maybe even writing it out to a CSV file. You’ll want to understand exactly how you can manipulate data because that is a huge part of a data scientist’s job.
  • Algorithms – use algorithms to build models and maybe even create your own models.
  • Data Visualizations – This is my favorite part of data science! There are multiple Python libraries or packages to help you do this.
  • Communication – Begin communicating these things that you’ve learned in a way that other people can explain to solidify that learning. 

What level of Python would someone need to know before they apply to Metis or any data science bootcamp? 

There are a couple of fundamentals that you need to get down before you move on to something more complicated. Those basic parts of Python, definitely data types and data structures, lists, the dictionary, those kinds of types of constructs.

You’ll also want to know at least these three basics: 

  • Conditionals – true and false tests. You’ll basically have some kind of input, you will test it against a condition, and if that test happens to be true, you’ll execute one block of code. If it’s false, you might execute a totally different block of codes. It’s kind of a gatekeeper. 
  • Loops – repeatable pieces of code. Anytime you need to repeat the same actions on many different items in a group, you might write a loop for that. This would execute over all the different elements in your group of inputs to produce some kind of standard outputs.
  • Functions – reusable code, not to be confused with repeatable code. If you want to perform the same type of calculation at various points in your code, you’ll write a function. You can reuse that bit of code any time you want the same outputs. 

To apply to Metis, you’ll at least need to be able to solve a conditional statement and be able to check inputs against some true or false statement and then perform various actions depending on if that was true or false.

How to Set-Up Python on a Mac

Installing new technology on your computer can be tough when you’re first beginning to learn how to code, but if you are using a Mac, you already have Python pre-installed! All a Mac user has to do is open up their terminal application, type the word Python in lowercase letters, hit enter, and you’re ready to do Python code. You can do the example mentioned in the video to test it out! 

If you’re not on a Mac – or even if you are, Metis often recommends data science students install AnacondaAnaconda is an all purpose Python package that is available for both Mac and Windows, so it doesn’t matter what you’re using. When you install Anaconda, you’re also installing common libraries that actual data scientists use. Anaconda also comes with Jupyter Notebook, which is a great tool for beginners to use. 

Python Libraries

It’s hard to talk about Python without talking about libraries. A library is a collection of saved code that someone else has written for you. You can import various bits of code so that you don’t have to do everything on your own! 

A few libraries that are perfect for beginners: 

  • Random – This is used to generate random numbers, which can be interesting. You could build your own game using this. 
  • Math – This one gives you access to all kinds of math functions like square root, cos, sine, and more. 
  • Collections – This will help you interface with your computer or collections, which gives you actual access to additional data structure types within Python. 

Once you have a handle on the fundamentals, our Metis bootcamp students learn: 

  • Pandas – For data wrangling and data manipulation because it allows a user to read data in, change it, look for missing values, read data out.
  • NumPy – For fast computation because it speeds up all of the different calculations that you’re doing. Pandas actually uses NumPy under the hood for some of its calculations!
  • Scikit-Learn – For machine learning because it has all of the algorithms you’ll want to use for regression, classification, and unsupervised learning. When you’re deep in the Immersive Data Science Bootcamp, you’ll be leveraging Scikit-Learn pretty heavily.
  • Matplotlib and Seaborn – For data visualizations. The most common ones will both be able to help you produce some nice visuals.

Python with Jupyter Notebook

Jupyter Notebook is an Integrated Development Environment (IDE), and it’s critical in the learning space for two reasons: 

  • It helps you understand what your code is doing instantaneously. You’ll be writing small blocks of code in cells and then executing that code immediately. This gives you instant feedback and shows you errors in your code, shows which functions you might need to change, and more. It allows you to learn more quickly and experiment more conveniently. 
  • You can also write in Jupyter Notebooks with text. You can include a message to yourself and you can even add images! This function is helpful for organizing your thoughts, remembering what you need to fix or change later, making a note about what a certain code block is doing, and recording steps you’re trying to follow. As an instructor, I can include an image of a code block for my students. 

Jupyter Notebook is great for building projects, structuring homework, and collaborative projects. The annotation feature is amazing because students can record their thought process and you can use this in a real-world work environment too!

About the author

Study on Scholarship Today -- Check your eligibility for up to 100% scholarship.

Leave a Comment