On 3 December 2026 we downloaded six copies of the iris dataset (UCI's two files, scikit-learn's, seaborn's, R's and Kaggle's most-voted copy), compared them row by row with the table in R. A. Fisher's 1936 paper, computed the summary statistics, drew the charts below and cross-validated five baseline models. Every output on this page comes from those runs, on a Windows 11 laptop with Python 3.14.3, pandas 3.1.2, scikit-learn 1.9.1, seaborn 0.13.2 and DuckDB 2.0.1.
The short answer: the iris dataset is 150 iris flowers, 50 each of Iris setosa, versicolor and virginica, with four measurements in centimeters: sepal length, sepal width, petal length and petal width. Edgar Anderson measured them and R. A. Fisher published them in 1936. Download it from the UCI Machine Learning Repository (a 3.7 KB zip under CC BY 4.0, DOI 10.24432/C56C76), or load it with no download from scikit-learn's load_iris() or R's built-in iris. UCI's iris.data and Kaggle's Iris Species copy differ from Fisher's table in two setosa rows, 35 and 38. Simple models score 94% to 98% in cross-validation. Checked 3 December 2026.
Fastero
Connect your database. Ask questions. Get dashboards.
Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.
Try free →Where to get the iris dataset: six copies compared
What we downloaded or loaded on 3 December 2026, and how each copy's rows 35 and 38 compare with Table I of Fisher's paper:
| Copy | How you get it | Rows 35 and 38 | License shown | Column names |
|---|---|---|---|---|
UCI iris.data |
3.7 KB zip from UCI, or fetch_ucirepo(id=53) |
Differ from Fisher | CC BY 4.0 | None: no header row |
UCI bezdekIris.data |
The same zip | Match Fisher | CC BY 4.0 | None: no header row |
scikit-learn load_iris() |
Ships inside the package, no download | Match (fixed in 0.20) | Package is BSD-3-Clause | sepal length (cm), ..., target 0 to 2 |
seaborn load_dataset("iris") |
Downloads a 3.9 KB CSV from GitHub, then caches it | Match | None on its GitHub repo | sepal_length, ..., species |
R iris |
Built into R, no download | Match | Not stated on its help page | Sepal.Length, ..., Species |
Kaggle "Iris Species" (uciml/iris) |
Download button or Kaggle's API: a 3.7 KB zip of a CSV and a SQLite file | Differ from Fisher | "CC0: Public Domain" | Id, SepalLengthCm, ..., Species |
All six have 150 rows and 50 flowers of each species. Which to use:
- Learning or a tutorial:
load_iris()in Python oririsin R. Nothing to download, and both match Fisher. - A CSV file for SQL, Excel or a BI tool: seaborn's
iris.csv, which has a header row and plain species names, or UCI'sbezdekIris.data. - Citing it in a paper: UCI's page, with its DOI and license, and Fisher (1936) for the data itself.
The two license labels disagree: UCI's page says the dataset "is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license", while Kaggle labels its copy "CC0: Public Domain". Crediting UCI and Fisher satisfies both.
What is the iris dataset?
Each row is one flower: four measurements, each to one decimal place in centimeters, and its species. UCI's description gives the property that made it a teaching classic: "One class is linearly separable from the other 2; the latter are not linearly separable from each other." Setosa is easy; telling versicolor from virginica is the real problem.
Who collected it. Edgar Anderson measured the flowers. Fisher's paper, "The use of multiple measurements in taxonomic problems", in Annals of Eugenics volume 7 (1936), pages 179 to 188, describes setosa and versicolor plants "found growing together in the same colony and measured by Dr E. Anderson". Fisher adds that the virginica sample differs "in not being taken from the same natural colony as they were". He cites Anderson's 1935 article "The irises of the Gaspe Peninsula" in the Bulletin of the American Iris Society, and R's help page puts it plainly: "The data were collected by Anderson (1935)." Where exactly the virginica flowers came from is less settled: a 2021 article in Significance by Antony Unwin and Kim Kleinman says "the origins of at least part of the data have been something of a mystery for decades"; the authors believe they have traced the source.
What Fisher used it for. The paper works through a linear discriminant function: the weighted sum of the four measurements that best separates two species. It then tests the suggestion that versicolor is a hybrid of the other two, by asking whether it "differs twice as much from I. setosa as from I. virginica". The journal's archive now carries its publisher's note that putting it online is not an endorsement of eugenics.
How to load the iris dataset in Python
pandas, from UCI's zip
UCI's zip holds four files. iris.data is the original; bezdekIris.data is the corrected one. Neither has a header row, so pass the names.
import io, urllib.request, zipfile
import pandas as pd
url = "https://archive.ics.uci.edu/static/public/53/iris.zip"
z = zipfile.ZipFile(io.BytesIO(urllib.request.urlopen(url).read()))
print(z.namelist())
cols = ["sepal_length", "sepal_width", "petal_length", "petal_width", "species"]
iris = pd.read_csv(z.open("bezdekIris.data"), header=None, names=cols) # corrected
old = pd.read_csv(z.open("iris.data"), header=None, names=cols) # original
print(iris.shape, iris.species.value_counts().to_dict())
rows = (old != iris).any(axis=1)
print(pd.concat({"iris.data": old[rows], "bezdekIris.data": iris[rows]}).iloc[:, :4])['Index', 'bezdekIris.data', 'iris.data', 'iris.names']
(150, 5) {'Iris-setosa': 50, 'Iris-versicolor': 50, 'Iris-virginica': 50}
sepal_length sepal_width petal_length petal_width
iris.data 34 4.9 3.1 1.5 0.1
37 4.9 3.1 1.5 0.1
bezdekIris.data 34 4.9 3.1 1.5 0.2
37 4.9 3.6 1.4 0.1pandas counts from 0, so 34 and 37 are rows 35 and 38. UCI's page also offers its ucimlrepo package (pip install ucimlrepo, then fetch_ucirepo(id=53)); version 0.0.7 returned the original iris.data values in our run, with 4.9, 3.1, 1.5, 0.1 in both rows.
scikit-learn: load_iris
from sklearn.datasets import load_iris
iris = load_iris(as_frame=True)
df = iris.frame # 4 feature columns + "target" (0, 1, 2)
print(df.shape, iris.target_names.tolist())
print(df.iloc[[34, 37]].to_string()) # rows 35 and 38, the two UCI fixed(150, 5) ['setosa', 'versicolor', 'virginica']
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) target
34 4.9 3.1 1.5 0.2 0
37 4.9 3.6 1.4 0.1 0The data is a 2.9 KB CSV inside the package, so this works offline. load_iris(return_X_y=True) gives the two NumPy arrays most tutorials start from.
seaborn: load_dataset("iris")
import seaborn as sns
iris = sns.load_dataset("iris") # downloads iris.csv from GitHub, then caches it
print(iris.groupby("species").mean().round(3))
iris.to_csv("iris.csv", index=False) sepal_length sepal_width petal_length petal_width
species
setosa 5.006 3.428 1.462 0.246
versicolor 5.936 2.770 4.260 1.326
virginica 6.588 2.974 5.552 2.026seaborn's docs say the loader "requires internet" and that "It is not necessary for normal usage": it exists for examples and bug reports. The setosa and versicolor means match Table II of Fisher's paper to the third decimal. For plotting it, see Seaborn vs Matplotlib.
Query the iris CSV with SQL in DuckDB
DuckDB reads a CSV file directly, detecting the header and column types. We ran these two queries over the iris.csv saved above with DuckDB 2.0.1's Python client (duckdb.sql(query).show()); the DuckDB command line takes the same SQL.
SELECT species,
count(*) AS flowers,
round(avg(petal_length), 2) AS avg_petal_cm,
min(petal_length) AS min_cm,
max(petal_length) AS max_cm
FROM 'iris.csv'
GROUP BY species
ORDER BY species;
SELECT *, count(*) AS copies
FROM 'iris.csv'
GROUP BY ALL
HAVING count(*) > 1;┌────────────┬─────────┬──────────────┬────────┬────────┐
│ species │ flowers │ avg_petal_cm │ min_cm │ max_cm │
│ varchar │ int64 │ double │ double │ double │
├────────────┼─────────┼──────────────┼────────┼────────┤
│ setosa │ 50 │ 1.46 │ 1.0 │ 1.9 │
│ versicolor │ 50 │ 4.26 │ 3.0 │ 5.1 │
│ virginica │ 50 │ 5.55 │ 4.5 │ 6.9 │
└────────────┴─────────┴──────────────┴────────┴────────┘
┌──────────────┬─────────────┬──────────────┬─────────────┬───────────┬────────┐
│ sepal_length │ sepal_width │ petal_length │ petal_width │ species │ copies │
│ double │ double │ double │ double │ varchar │ int64 │
├──────────────┼─────────────┼──────────────┼─────────────┼───────────┼────────┤
│ 5.8 │ 2.7 │ 5.1 │ 1.9 │ virginica │ 2 │
└──────────────┴─────────────┴──────────────┴─────────────┴───────────┴────────┘The first query already shows the gap: no setosa petal is longer than 1.9 cm, and no other flower's is shorter than 3.0 cm. The second finds the dataset's one duplicated flower, rows 102 and 143. UCI's iris.data has more: its setosa rows 10, 35 and 38 are three identical flowers, because both errors turn rows 35 and 38 into copies of row 10.
How to load the iris dataset in R
R isn't installed on the laptop we used, so this snippet is not run here. iris ships with base R, so there is nothing to download:
data(iris)
str(iris) # 150 obs. of 5 variables
aggregate(. ~ Species, data = iris, FUN = mean)
iris[c(35, 38), ] # Fisher: 4.9 3.1 1.5 0.2 and 4.9 3.6 1.4 0.1We did compare R's data itself: R's source file for the dataset, datasets/data/iris.R, holds the same 150 rows as scikit-learn's copy, row for row.
Which iris dataset is correct? The two rows that differ
We checked every copy against scikit-learn's, row by row, then checked rows 35 and 38 against a scan of Fisher's Table I. Only two rows differ anywhere, both setosa:
| Row | Fisher 1936, Table I | UCI iris.data and Kaggle |
What differs |
|---|---|---|---|
| 35 | 4.9, 3.1, 1.5, 0.2 | 4.9, 3.1, 1.5, 0.1 | Petal width |
| 38 | 4.9, 3.6, 1.4, 0.1 | 4.9, 3.1, 1.5, 0.1 | Sepal width and petal length |
Fisher's own Table II gives a second check that needs no row numbers: setosa's mean sepal width is 3.428 cm in his paper and in the corrected copies, and 3.418 cm in iris.data.
UCI documents the problem on its page: "This data differs from the data presented in Fishers article", followed by the two correct rows; its notes say Steve Chadwick identified the discrepancy. The corrected file is named after Bezdek and four co-authors, whose 1999 note in IEEE Transactions on Fuzzy Systems is titled "Will the real iris data please stand up?" Since version 0.20, scikit-learn ships the corrected rows, and its docs say "Note that it's the same as in R, but not as in the UCI Machine Learning Repository, which has two wrong data points." One leftover: the summary table in scikit-learn's description still gives sepal width's standard deviation as 0.43 and its class correlation as -0.4194. Those are the uncorrected file's numbers; the corrected data gives 0.44 and -0.4267.
Does it matter? For a first model, no: the cross-validated accuracy below was identical on both versions for three of four models, and 94.8% against 94.9% for k-nearest neighbors. For matching a published statistic, or a test that checks exact values, it does, so say which copy you used.
Iris dataset summary statistics
Computed with pandas on the corrected data; mean ± standard deviation (sample, n-1), then the range, in centimeters:
| Measurement | All 150 | Setosa | Versicolor | Virginica |
|---|---|---|---|---|
| Sepal length | 5.84 ± 0.83 (4.3-7.9) | 5.01 ± 0.35 (4.3-5.8) | 5.94 ± 0.52 (4.9-7.0) | 6.59 ± 0.64 (4.9-7.9) |
| Sepal width | 3.06 ± 0.44 (2.0-4.4) | 3.43 ± 0.38 (2.3-4.4) | 2.77 ± 0.31 (2.0-3.4) | 2.97 ± 0.32 (2.2-3.8) |
| Petal length | 3.76 ± 1.77 (1.0-6.9) | 1.46 ± 0.17 (1.0-1.9) | 4.26 ± 0.47 (3.0-5.1) | 5.55 ± 0.55 (4.5-6.9) |
| Petal width | 1.20 ± 0.76 (0.1-2.5) | 0.25 ± 0.11 (0.1-0.6) | 1.33 ± 0.20 (1.0-1.8) | 2.03 ± 0.27 (1.4-2.5) |
There are no missing values. Petal length and petal width are almost the same signal, with a correlation of 0.96, and each correlates above 0.8 with sepal length. Sepal width and sepal length barely relate across all 150 flowers (-0.12), yet within each species they rise together, with correlations of 0.46 to 0.74. Pooling the species hides it, because setosa has short, wide sepals.

Every flower's four measurements, from the corrected iris data, drawn 3 December 2026. Setosa is blue, versicolor orange and virginica green in every chart on this page.
Connect any database. Ask in plain English.
Start free →Iris dataset visualization: petals and a PCA
The petal measurements alone draw the picture UCI describes. Setosa sits in its own corner. Versicolor and virginica touch: a single cut at 1.75 cm of petal width puts 6 of those 100 flowers on the wrong side. Measurements to one decimal place also repeat, so the 150 flowers make only 103 distinct points on this chart, and the bigger dots are several flowers each.

Petal length and width by species, from the corrected iris data, drawn 3 December 2026.
Principal component analysis squeezes all four measurements into two axes. After scaling each measurement to the same spread, the first two components keep 95.8% of the variation:
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
X, y = load_iris(return_X_y=True)
Z = StandardScaler().fit_transform(X) # all four measurements on one scale
pca = PCA(n_components=2).fit(Z)
print(pca.explained_variance_ratio_.round(3))
print(pca.components_.round(2)) # rows: PC1, PC2; columns: the 4 features[0.73 0.229]
[[ 0.52 -0.27 0.58 0.56]
[ 0.38 0.92 0.02 0.07]]The first component weighs sepal length, petal length and petal width almost equally (0.52 to 0.58) against sepal width; the second is almost all sepal width (0.92).

The four measurements, standardized, on their first two principal components (scikit-learn 1.9.1), 3 December 2026.
Iris classification: a first model in scikit-learn
We compared four standard classifiers and a do-nothing baseline with scikit-learn's defaults. Each was scored by 10-fold stratified cross-validation repeated 10 times with different shuffles: 100 splits, each training on 135 flowers and testing on the other 15, with 5 of each species.
from sklearn.datasets import load_iris
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import RepeatedStratifiedKFold, cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
def scaled(model):
return make_pipeline(StandardScaler(), model)
X, y = load_iris(return_X_y=True)
cv = RepeatedStratifiedKFold(n_splits=10, n_repeats=10, random_state=42)
models = {
"Majority class (baseline)": DummyClassifier(strategy="most_frequent"),
"Logistic regression": scaled(LogisticRegression(max_iter=1000)),
"k-nearest neighbors (k=5)": scaled(KNeighborsClassifier(5)),
"Decision tree": DecisionTreeClassifier(random_state=0),
"Linear discriminant analysis": LinearDiscriminantAnalysis(),
}
for name, model in models.items():
scores = cross_val_score(model, X, y, cv=cv, scoring="accuracy")
print(f"{name:30s} {scores.mean():.3f} ± {scores.std():.3f} ({len(scores)} folds)")Majority class (baseline) 0.333 ± 0.000 (100 folds)
Logistic regression 0.954 ± 0.048 (100 folds)
k-nearest neighbors (k=5) 0.949 ± 0.051 (100 folds)
Decision tree 0.943 ± 0.057 (100 folds)
Linear discriminant analysis 0.979 ± 0.035 (100 folds)The 500 model fits took 5 to 14 seconds per run, including Python's start-up, over six runs on a laptop shared with other jobs, and the output was identical each time.

Mean accuracy over 100 cross-validation folds, scikit-learn 1.9.1 defaults, run 3 December 2026.
How to read it:
- The baseline is 33.3%, because the classes are balanced. Every real model is far above it.
- The models are closer than the bars suggest. One flower in a 15-flower fold is 6.7 points, and the fold-to-fold spread is 3.5 to 5.7 points. In one shuffled 10-fold pass, linear discriminant analysis misclassified 4 of the 150 flowers, k-nearest neighbors 6, logistic regression 7 and the tree 9.
- Setosa wasn't the problem. In that pass no model misclassified a setosa, or called another flower one: every error was versicolor against virginica.
- Scaling isn't needed here. All four features are in centimeters. Without the scaler, logistic regression scored 96.8% and k-nearest neighbors 96.5% in the same setup, a gain of about two flowers in 150.
- Linear discriminant analysis descends from Fisher's 1936 method, so it is no surprise it fits his data best.
Why everyone uses the iris dataset, and what to use next
Iris is small enough to print, has no missing values, balanced classes and four numeric features in one unit, and it ships inside scikit-learn and R. UCI's own notes call it "an exceedingly simple domain", which is also its limit: with every sensible model at 94% to 98%, it can't tell methods apart, and it never makes you clean anything.
Good next datasets, all free:
- Palmer Penguins: 344 penguins of three species from three islands in the Palmer Archipelago, Antarctica, with bill, flipper and body-mass measurements, sex and year. Its README sets the goal of a dataset for exploration and visualization "as an alternative to" iris, and its data is under CC0. It has the mess iris lacks: in seaborn's copy (
sns.load_dataset("penguins")) 11 rows have missing values, 2 of them with no measurements at all. In R it's thepalmerpenguinspackage. - scikit-learn's wine and breast cancer data: 178 wines with 13 features and three classes, and 569 samples with 30 features and two classes. Both ship with scikit-learn, like iris.
- Something bigger or messier: our guides to free datasets and Kaggle datasets, and, for SQL practice, sample databases.
Where to run the iris code for free
Everything above runs on a laptop in seconds. To skip installing Python, use Google Colab or Kaggle Notebooks: Colab's published package list and Kaggle's notebook image both include scikit-learn. On Kaggle, attaching "Iris Species" takes a click, but it's the copy with UCI's two errors, so load_iris() is the better start. Limits and alternatives: Kaggle Notebooks, Google Colab alternatives and Jupyter notebooks online.
Using the iris dataset in Fastero
Fastero is an AI and data platform where people and AI agents work together on a team's data, and it runs in the browser. With iris, on the Free plan (no end date, no card):
- Upload
iris.csvto a project. Fastero's notebooks can't be relied on to download a dataset from a URL, so upload the 4 KB file; the limit is 100 MB a file, within the plan's 500 MB of storage. - Query it with SQL in the SQL editor, chart it, or ask the AI chat a question about the file. It writes and runs the SQL, paid from the $20 of AI usage every new account starts with.
- Read it from a notebook by path with pandas, and plot it with seaborn or plotly, which come preinstalled with Python 3.11.
Two limits matter for this post. scikit-learn isn't preinstalled, and a %pip install lasts only for that session; there is no R either. And Fastero has no GPU. For scikit-learn ready to go or a free GPU, use Kaggle or Colab. Fastero fits when the analysis has to sit next to a team's own data, run on a schedule and be opened by colleagues, who sign in as free viewers. Plans: pricing.

A notebook in Fastero: a Python cell and the matplotlib chart it drew, on sample data, not the iris file.
FAQ
What is the iris dataset used for?
Learning: loading data, plotting, and a first classification model. Its 150 rows, four numeric features and three balanced classes make every step quick to check by eye. It's too easy for comparing methods, since simple models all score 94% to 98%.
How many rows and columns does the iris dataset have?
150 rows, one per flower, and five columns: sepal length, sepal width, petal length and petal width in centimeters, and the species. There are 50 flowers of each species and no missing values.
Who created the iris dataset?
Edgar Anderson measured the flowers, and R. A. Fisher published the measurements in "The use of multiple measurements in taxonomic problems", Annals of Eugenics, 1936. Fisher states that the setosa and versicolor plants grew together in one colony and the virginica sample came from another.
Why do iris datasets differ?
Some copies, including UCI's original iris.data and Kaggle's Iris Species, carry two errors, in setosa rows 35 and 38. scikit-learn's load_iris(), seaborn's copy, R's iris and UCI's bezdekIris.data match Fisher's 1936 table. Check row 35's petal width: 0.2 is Fisher's value, 0.1 the error.
Is the iris dataset free to use?
Yes. UCI publishes it under CC BY 4.0, which allows any use with credit, and Kaggle labels its copy CC0. Cite UCI's DOI, 10.24432/C56C76, and Fisher's paper.
What accuracy should I expect on the iris dataset?
Around 94% to 98% with default scikit-learn models. In our 100-fold cross-validation, linear discriminant analysis scored 97.9%, logistic regression 95.4%, k-nearest neighbors 94.9% and a decision tree 94.3%. A perfect score on one small test split proves little: 45 of the 100 folds of 15 flowers scored 100% with logistic regression.
How do I load the iris dataset in Python?
from sklearn.datasets import load_iris, then load_iris(as_frame=True).frame for a pandas DataFrame, with no download. seaborn's sns.load_dataset("iris") downloads a CSV with plain column names, and pandas can read UCI's bezdekIris.data with header=None and your own column names.
Sources
Read, downloaded and run on 3 December 2026:
- UCI Machine Learning Repository: Iris dataset page (license, DOI, errata note), iris.zip with
iris.names - R. A. Fisher (1936), "The use of multiple measurements in taxonomic problems", Annals of Eugenics 7(2): 179-188, doi:10.1111/j.1469-1809.1936.tb02137.x; we read the scan in the University of Adelaide's Fisher collection (Tables I and II and pages 179 to 181, 185 and 188)
- J. C. Bezdek, J. M. Keller, R. Krishnapuram, L. I. Kuncheva, N. R. Pal (1999), "Will the real iris data please stand up?", IEEE Transactions on Fuzzy Systems 7(3): 368-369, doi:10.1109/91.771092 (citation from Crossref; IEEE's page refused our automated request)
- A. Unwin, K. Kleinman (2021), "The Iris Data Set: In Search of the Source of Virginica", Significance 18(6): 26-29, doi:10.1111/1740-9713.01589 (abstract from Crossref)
- scikit-learn: load_iris, Toy datasets, Release notes for 0.20, repository license
- seaborn: load_dataset, seaborn-data repository
- R: iris help page, iris.R in R's source (GitHub mirror)
- Kaggle: Iris Species, metadata and search results from Kaggle's public API; Kaggle's notebook image requirements
- Google: Colab's package list
- Palmer Penguins: palmerpenguins README
- DuckDB: CSV import
- Our runs: Windows 11, Intel Core i7-11800H, Python 3.14.3, pandas 3.1.2, NumPy 2.5.5, scikit-learn 1.9.1, seaborn 0.13.2, DuckDB 2.0.1, ucimlrepo 0.0.7
Try Fastero free: upload iris.csv, query it with SQL and chart it in a notebook, then do the same with your team's own data. No credit card required.
Fastero Dev Team