Data Types in Python
Consolidate and extend your knowledge of Python data types such as lists, dictionaries, and tuples, leveraging them to solve Data Science problems.
Start Course for Free4 hours15 videos47 exercises
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Training 2 or more people?Try DataCamp For Business
Loved by learners at thousands of companies
Course Description
Have you got your basic Python programming chops down but are yearning for more? Then this is the course for you. Herein, you'll consolidate and practice your knowledge of lists, dictionaries, tuples, sets, and date times. You'll see their relevance in working with lots of real data and how to leverage several of them in concert to solve multistep problems, including an extended case study using Chicago metropolitan area transit data. You'll also learn how to use many of the objects in the Python Collections module, which will allow you to store and manipulate your data for a variety of purposes. After taking this course, you'll be ready to tackle many data challenges Pythonically.
For Business
Training 2 or more people?
Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and moreIn the following Tracks
Associate Python Developer
Go To TrackPython Programming Fundamentals
Go To Track- 1
Fundamental Sequence Data Types
FreeThis chapter will introduce you to the fundamental Python data types - lists, sets, and strings. These data containers are critical as they provide the basis for storing and looping over ordered data. To make things interesting, you'll apply what you learn about these types to answer questions about the New York Baby Names dataset!
Introduction and lists50 xpManipulating lists for fun and profit100 xpLooping over lists100 xpMeet the tuples50 xpData type usage50 xpUsing and unpacking tuples100 xpMaking tuples by accident100 xpStrings50 xpFormatted String Literals ("f" strings)100 xpCombining multiple strings100 xpFinding strings in other strings100 xp - 2
Dictionaries - The Root of Python
At the root of all things Python is a dictionary. Herein, you'll learn how to use them to safely handle data that can viewed in a variety of ways to answer even more questions about the New York Baby Names dataset. You'll explore how to loop through data in a dictionary, access nested data, add new data, and come to appreciate all of the wonderful capabilities of Python dictionaries.
Using dictionaries50 xpCreating and looping through dictionaries100 xpSafely finding by key100 xpAltering dictionaries50 xpAdding and extending dictionaries100 xpPopping and deleting from dictionaries100 xpPythonically using dictionaries50 xpWorking with dictionaries more pythonically100 xpChecking dictionaries for data100 xpMixed data types in dictionaries50 xpDealing with nested dictionaries100 xpDealing with nested mixed types100 xp - 3
Numeric Data Types, Booleans, and Sets
Let's take a step away from dictionaries and look at some other common numeric and boolean data types along with sets.
Numeric data types50 xpChoosing when to use integers and floats100 xpPrinting floats100 xpDivision with integers and floats100 xpBooleans - The logical data type50 xpMore than just true and false100 xpComparisons100 xpTruthy, True, Falsey, and False100 xpSets (unordered data with optimized logic operations)50 xpDetermining set differences100 xpFinding all the data and the overlapping data between sets100 xp - 4
Advanced Data Types
Some data types are composites of other data types and give me even more capabilities than a fundamental data type. Let's explore a few complex types from the collections module and data classes.
Counting made easy50 xpUsing Counter on lists100 xpFinding most common elements100 xpDictionaries of unknown structure - Defaultdict50 xpCreating dictionaries of an unknown structure100 xpSafely appending to a key's value list100 xpWhat do you mean I don't have any class? Namedtuple50 xpCreating namedtuples for storing data100 xpLeveraging attributes on namedtuples100 xpDataclasses50 xpCreating a dataclass100 xpUsing dataclasses100 xpWrap-up50 xp
For Business
Training 2 or more people?
Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and moreIn the following Tracks
Associate Python Developer
Go To TrackPython Programming Fundamentals
Go To Trackcollaborators
prerequisites
Python ToolboxJason Myers
See MoreCo-Author of Essential SQLAlchemy and Software Engineer
Jason Myers is a software engineer and author. His area of expertise is in developing data analytics platforms. He has also written the Essential SQLAlchemy book, co-authored with Rick Copeland, that introduces you to working with relational databases in Python.
Join over 14 million learners and start Data Types in Python today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.