How to Load Data in Python with Scikit-Learn

Last Updated on December 13, 2019

Before you can build machine learning models, you need to load your data into memory.

In this post you will discover how to load data for machine learning in Python using scikit-learn.

Kick-start your project with my new book Machine Learning Mastery With Python, including step-by-step tutorials and the Python source code files for all examples.

Let’s get started.

  • Update March/2018: Added alternate link to download the dataset as the original appears to have been taken down.
load csv data

Load CSV Data
Photo by Jim Makos, some rights reserved

Packaged Datasets

The scikit-learn library is packaged with datasets. These datasets are useful for getting a handle on a given machine learning algorithm or library feature before using it in your own work.

This recipe demonstrates how to load the famous Iris flowers dataset.