Skip to main content
HomePythonIntroduction to Importing Data in Python

Introduction to Importing Data in Python

4.6+
80 reviews
Beginner

Learn to import data into Python from various sources, such as Excel, SQL, SAS and right from the web.

Start Course for Free
3 Hours15 Videos54 Exercises
287,650 LearnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
GroupTraining 2 or more people?Try DataCamp For Business

Loved by learners at thousands of companies


Course Description

As a data scientist, you will need to clean data, wrangle and munge it, visualize it, build predictive models, and interpret these models. Before you can do so, however, you will need to know how to get data into Python. In this course, you'll learn the many ways to import data into Python: from flat files such as .txt and .csv; from files native to other software such as Excel spreadsheets, Stata, SAS, and MATLAB files; and from relational databases such as SQLite and PostgreSQL.
For Business

GroupTraining 2 or more people?

Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and more
Try DataCamp for BusinessFor a bespoke solution book a demo.

In the following Tracks

Certification Available

Data Engineer in Python

Go To Track
Certification Available

Associate Data Scientist in Python

Go To Track

Importing & Cleaning Data with Python

Go To Track
  1. 1

    Introduction and flat files

    Free

    In this chapter, you'll learn how to import data into Python from all types of flat files, which are a simple and prevalent form of data storage. You've previously learned how to use NumPy and pandas—you will learn how to use these packages to import flat files and customize your imports.

    Play Chapter Now
    Welcome to the course!
    50 xp
    Exploring your working directory
    50 xp
    Importing entire text files
    100 xp
    Importing text files line by line
    100 xp
    The importance of flat files in data science
    50 xp
    Pop quiz: examples of flat files
    50 xp
    Pop quiz: what exactly are flat files?
    50 xp
    Why we like flat files and the Zen of Python
    50 xp
    Importing flat files using NumPy
    50 xp
    Using NumPy to import flat files
    100 xp
    Customizing your NumPy import
    100 xp
    Importing different datatypes
    100 xp
    Working with mixed datatypes (1)
    50 xp
    Working with mixed datatypes (2)
    100 xp
    Importing flat files using pandas
    50 xp
    Using pandas to import flat files as DataFrames (1)
    100 xp
    Using pandas to import flat files as DataFrames (2)
    100 xp
    Customizing your pandas import
    100 xp
    Final thoughts on data import
    50 xp
  2. 2

    Importing data from other file types

    You've learned how to import flat files, but there are many other file types you will potentially have to work with as a data scientist. In this chapter, you'll learn how to import data into Python from a wide array of important file types. These include pickled files, Excel spreadsheets, SAS and Stata files, HDF5 files, a file type for storing large quantities of numerical data, and MATLAB files.

    Play Chapter Now
For Business

GroupTraining 2 or more people?

Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and more

In the following Tracks

Certification Available

Data Engineer in Python

Go To Track
Certification Available

Associate Data Scientist in Python

Go To Track

Importing & Cleaning Data with Python

Go To Track

Datasets

Chinook (SQLite)LIGO (HDF5)Battledeath (XLSX)Extent of infectious diseases (DTA)Gene expressions (MATLAB)MNISTSales (SAS7BDAT)SeaslugsTitanic

Collaborators

Collaborator's avatar
Francisco Castro

Prerequisites

Intermediate Python
Hugo Bowne-Anderson HeadshotHugo Bowne-Anderson

Data Scientist

Hugo is a data scientist, educator, writer and podcaster formerly at DataCamp. His main interests are promoting data & AI literacy, helping to spread data skills through organizations and society and doing amateur stand up comedy in NYC. If you want to know what he likes to talk about, definitely check out DataFramed, the DataCamp podcast, which he hosted and produced.
See More

Don’t just take our word for it

*4.6
from 80 reviews
75%
18%
5%
3%
0%
Sort by
  • Taher A.
    2 months

    Nice course

  • Grigorios P.
    2 months

    Great tools, great teacher.

  • Mohamed C.
    4 months

    Well presented course and easy to follow. Hugo Browne-Anderson explains very well and makes difficult concepts easy to understand.

  • Pramod P.
    5 months

    It was great

  • Jagrit S.
    6 months

    Hugo is an amazing instructor.

"Nice course"

Taher A.

"Great tools, great teacher."

Grigorios P.

"Well presented course and easy to follow. Hugo Browne-Anderson explains very well and makes difficult concepts easy to understand."

Mohamed C.

FAQs

Join over 14 million learners and start Introduction to Importing Data in Python today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.