plant mislabeling
#9
by
egrace479 - opened
- data/taxa_files/README.md +49 -0
- data/taxa_files/ToL_hybrids_Arthropoda.csv +3 -0
- data/taxa_files/metadata.csv +13 -0
- data/taxa_files/sample_arthropoda_mislabels.txt +12 -0
- data/taxa_files/sample_images/20507360_64639770_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/22255430_64639830_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/29906970_65415246_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/29907020_65415246_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/30038365_65415248_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8757019_49951271_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8757071_49951271_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8757093_49951271_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8757102_49951271_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8791997_49952170_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8792002_49952170_eol-full-size-copy.jpg +3 -0
- data/taxa_files/sample_images/8922943_49955771_eol-full-size-copy.jpg +3 -0
- notebooks/make_ToL_hybrids_Arthropoda_EDA.ipynb +1675 -0
data/taxa_files/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Taxa Files -- Hemihomonym Exploration
|
| 2 |
+
|
| 3 |
+
## Background
|
| 4 |
+
|
| 5 |
+
While looking for a hybrid subset for the [HDR Anomaly Detection ML Challenge](https://github.com/Imageomics/HDR-anomaly-challenge), I found that we had some plants mislabeled (from family up) to the phyla _Artrhopoda_ and _Chordata_ (possibly others).
|
| 6 |
+
|
| 7 |
+
It seems at least two of the genera that were potentially mislabeled on the higher order are known homonyms/hemihomonyms indicated in the [IRMNG list](https://www.irmng.org/homonyms.php) (see [genus level L](https://www.irmng.org/homonyms.php?tRank=180&start_letter=L) and [genus level V](https://www.irmng.org/homonyms.php?tRank=180&start_letter=V)):
|
| 8 |
+
> Laelia
|
| 9 |
+
> [Laelia J. Lindley, 1831](https://www.irmng.org/aphia.php?p=taxdetails&id=1373938) · Plantae (Kingdom) > Tracheophyta (Phylum) > Magnoliopsida (Class) > Asparagales (Order) > Orchidaceae (Family)
|
| 10 |
+
> X [Laelia Adanson, 1763](https://www.irmng.org/aphia.php?p=taxdetails&id=1373939) accepted as [Laelia Adanson, 1763](https://www.irmng.org/aphia.php?p=taxdetails&id=1373939) · Plantae (Kingdom) > Tracheophyta (Phylum) > Magnoliopsida (Class) > Brassicales (Order) > Brassicaceae (Family)
|
| 11 |
+
> X [Laelia Persoon, 1806](https://www.irmng.org/aphia.php?p=taxdetails&id=1373969) accepted as · Plantae (Kingdom) > Tracheophyta (Phylum) > Magnoliopsida (Class) > Brassicales (Order) > Brassicaceae (Family)
|
| 12 |
+
> [Laelia Stephens, 1828](https://www.irmng.org/aphia.php?p=taxdetails&id=1373968) · Animalia (Kingdom) > Arthropoda (Phylum) > Insecta (Class) > Lepidoptera (Order) > Erebidae (Family)
|
| 13 |
+
|
| 14 |
+
and
|
| 15 |
+
|
| 16 |
+
> Viola
|
| 17 |
+
> [Viola Evans, 1953](https://www.irmng.org/aphia.php?p=taxdetails&id=1332389) · Animalia (Kingdom) > Arthropoda (Phylum) > Insecta (Class) > Lepidoptera (Order) > Hesperiidae (Family)
|
| 18 |
+
> [Viola Linnaeus, 1753](https://www.irmng.org/aphia.php?p=taxdetails&id=1332414) · Plantae (Kingdom) > Tracheophyta (Phylum) > Magnoliopsida (Class) > Malpighiales (Order) > Violaceae (Family)
|
| 19 |
+
|
| 20 |
+
This may be part of the reason we had so many misclassifications into _Arthropoda_.
|
| 21 |
+
|
| 22 |
+
## Exploratory Files
|
| 23 |
+
|
| 24 |
+
There is a notebook that partially explores this (`notebooks/make_ToL_hybrids_Arthropoda_EDA.ipynb`) and two associated files (`data/taxa_files/ToL_hybrids_Arthropoda.csv` and `data/taxa_files/sample_arthropoda_mislabels.txt`), the latter of which is a list of filenames for the sample images in `data/taxa_files/sample_images/`.
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
`ToL_hybrids_Arthropoda.csv` is a subset of the EOL subset of the TreeOfLife-10M dataset and has the following columns:
|
| 28 |
+
- `treeoflife_id`: unique identifier for the image in the dataset.
|
| 29 |
+
- `eol_content_id`: unique identifier within EOL database for images sourced from [EOL](https://eol.org). Note that EOL content IDs are not stable.
|
| 30 |
+
- `eol_page_id`: identifier of page from which images from EOL are sourced. Note that an image's association to a particular page ID may change with updates to the EOL (or image provider's) hierarchy. However, EOL taxon page IDs are stable.
|
| 31 |
+
- `kingdom`: kingdom to which the subject of the image belongs (`Animalia`, `Plantae`) -- double check just the two
|
| 32 |
+
- `phylum`: phylum to which the subject of the image belongs.
|
| 33 |
+
- `class`: class to which the subject of the image belongs.
|
| 34 |
+
- `order`: order to which the subject of the image belongs.
|
| 35 |
+
- `family`: family to which the subject of the image belongs.
|
| 36 |
+
- `genus`: genus to which the subject of the image belongs.
|
| 37 |
+
- `species`: species to which the subject of the image belongs.
|
| 38 |
+
- `common`: common name associated with the subject of the image where available. Otherwise, this is the scientific name (`genus-species`), else whatever subset of the taxonomic hierarchy is available (eg., `kingdom-phylum-class-order` or `kingdom-phylum-class-order-family`). All images have a non-null entry for this column.
|
| 39 |
+
|
| 40 |
+
`metadata.csv` is the `sample_image` subset of `ToL_hybrids_Arthropoda.csv` merged with the [TreeOfLife-10M license file](https://huggingface.co/datasets/imageomics/TreeOfLife-10M/blob/main/metadata/licenses.csv), so it has all columns listed above plus the following:
|
| 41 |
+
- `md5`: MD5 hash of the image.
|
| 42 |
+
- `medium_source_url`: URL pointing to source of image.
|
| 43 |
+
- `eol_full_size_copy_url`: URL to access the full-sized image; this is the URL from which the image was downloaded for this dataset (see [ToL-10M Initial Data Collection and Normalization](https://huggingface.co/datasets/imageomics/TreeOfLife-10M#initial-data-collection-and-normalization) for more information on this process).
|
| 44 |
+
- `license_name`: name of license attached to the image (`cc-publicdomain`, `cc-by-sa-3.0`, `cc-by-nc-sa-3.0`, `cc-by-nc-4.0`, `cc-by-nc`). All sample images are shared under their original licenses, as indicated in this file.
|
| 45 |
+
- `copyright_owner`: copyright holder for the image.
|
| 46 |
+
- `license_link`: URL to the listed license.
|
| 47 |
+
- `title`: title provided for the image, filled with `not provided` if no title was provided (all images in this subset).
|
| 48 |
+
|
| 49 |
+
As a result of this discovery, we performed a re-resolution of the TreeOfLife-10M taxonomy from the original published dataset ([TreeOfLife-10M (Revision 69ca82e), DOI: 10.57967/hf/1972](https://huggingface.co/datasets/imageomics/TreeOfLife-10M/tree/69ca82e7481dcae0764f7c5452ea32b3a41cf620), the reproducibility + embeddings update to the original is [Revision ffa2a31, DOI: 10.57967/hf/7542](https://huggingface.co/datasets/imageomics/TreeOfLife-10M/tree/ffa2a318a1396f2f9e456ba171d3b5b5d8b4f051)). This was completed using [TaxonoPy](https://github.com/Imageomics/TaxonoPy), which was created to align the taxonomy across source datasets used for [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M).
|
data/taxa_files/ToL_hybrids_Arthropoda.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15bfc6b9f9f68bdd8469a9f5957bdd0e123debb801329f096f00eba6aef89ade
|
| 3 |
+
size 48484532
|
data/taxa_files/metadata.csv
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
treeoflife_id,kingdom,phylum,class,order,family,genus,species,common,filename,eol_content_id,eol_page_id,md5,medium_source_url,eol_full_size_copy_url,license_name,copyright_owner,license_link,title
|
| 2 |
+
9109d540-e646-4e50-b920-ca53a8985259,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,chamissoniana,olopu,8792002_49952170_eol-full-size-copy.jpg,8792002,49952170,1a014627197f10bf89cf581358b878fe,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0912/0379.jpeg,https://content.eol.org/data/media/86/c6/33/7.CalPhotos_0000_0000_0912_0379.jpg,cc-by-nc-sa-3.0,2012 Eric White,https://creativecommons.org/licenses/by-nc-sa/3.0,not provided
|
| 3 |
+
6488b660-d6fa-44d5-9304-a97390dc08df,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,wittrockiana,hybrid violet,8757102_49951271_eol-full-size-copy.jpg,8757102,49951271,6d8395676b9b27ee0f4b8f39d8b9feff,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0709/2225.jpeg,https://content.eol.org/data/media/86/4d/d2/7.CalPhotos_0000_0000_0709_2225.jpg,cc-publicdomain,2009 Nick Kurzenko,https://creativecommons.org/publicdomain/zero/1.0,not provided
|
| 4 |
+
7bf000bb-8f79-44ec-b7e2-c21922607a41,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,eriocarpon,Viola eriocarpon,22255430_64639830_eol-full-size-copy.jpg,22255430,64639830,367311dfc60f80478a9c7aa2ddcd0e66,https://inaturalist-open-data.s3.amazonaws.com/photos/118802098/original.jpg,https://content.eol.org/data/media/57/72/13/18.0d74b432a707959c26555b20a538109a.jpg,cc-by-nc-4.0,e_skees2021,https://creativecommons.org/licenses/by-nc/4.0,not provided
|
| 5 |
+
f20acda4-cdfd-49de-b89a-6e1dbea9d250,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,biflora,arctic yellow violet,20507360_64639770_eol-full-size-copy.jpg,20507360,64639770,93805d5184805d0adc100ec17969d1ed,https://inaturalist-open-data.s3.amazonaws.com/photos/91149264/original.jpeg,https://content.eol.org/data/media/72/1e/59/18.a27fd924df43bed1cefb6a0a596e8dea.jpg,cc-by-nc-4.0,Tommy Landry,https://creativecommons.org/licenses/by-nc/4.0,not provided
|
| 6 |
+
3980fca2-4f1a-47ce-85db-632f2dc2ae30,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,langsdorffii,Aleutian violet,30038365_65415248_eol-full-size-copy.jpg,30038365,65415248,dfc0ed93a3d2a0e69b0eacf16ebc1dcb,https://upload.wikimedia.org/wikipedia/commons/4/43/Viola_langsdorfii_subsp._sachalinensis_1.JPG,https://content.eol.org/data/media/f6/e6/41/509.937c7c8fd6f104f17882fec942a23b88.jpg,cc-by-sa-3.0,Qwert1234,https://creativecommons.org/licenses/by-sa/3.0,not provided
|
| 7 |
+
3f4286e5-b5d7-4533-9130-ef5d15a1c048,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,purpurea,goosefoot violet,8922943_49955771_eol-full-size-copy.jpg,8922943,49955771,6507c2423931c44b53d93c3c13ac7b33,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0612/0108.jpeg,https://content.eol.org/data/media/86/23/db/7.CalPhotos_0000_0000_0612_0108.jpg,cc-by-nc,2012 Steve Matson,https://creativecommons.org/licenses/by-nc/4.0,not provided
|
| 8 |
+
e8190144-9033-4998-92be-ae278e4baedb,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,×williamsii,Viola ×williamsii,29907020_65415246_eol-full-size-copy.jpg,29907020,65415246,573d137af05e63b6937bf55dfcaf0b9e,https://upload.wikimedia.org/wikipedia/commons/6/61/Viola_cornuta_Babyface_Ruby_And_Gold_0zz.jpg,https://content.eol.org/data/media/65/da/45/509.edf29ddb4d5abf13b7434f076efa61c7.jpg,cc-by-sa-3.0,Photo by David J. Stang,https://creativecommons.org/licenses/by-sa/3.0,not provided
|
| 9 |
+
aa4abda6-2b9a-400f-8d27-16be1d75b577,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,wittrockiana,hybrid violet,8757093_49951271_eol-full-size-copy.jpg,8757093,49951271,cdd3c262f69d3f61e81eb3f464d0d553,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0709/2216.jpeg,https://content.eol.org/data/media/86/4d/c9/7.CalPhotos_0000_0000_0709_2216.jpg,cc-publicdomain,2009 Nick Kurzenko,https://creativecommons.org/publicdomain/zero/1.0,not provided
|
| 10 |
+
875156a5-5811-4069-ab8d-ee51c0ae0454,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,chamissoniana,olopu,8791997_49952170_eol-full-size-copy.jpg,8791997,49952170,fa092cb496576ced7bca0f87f9e59f24,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0514/2032.jpeg,https://content.eol.org/data/media/85/f3/85/7.CalPhotos_0000_0000_0514_2032.jpg,cc-by-nc-sa-3.0,2014 Eric White,https://creativecommons.org/licenses/by-nc-sa/3.0,not provided
|
| 11 |
+
1ae66dcb-84c5-43ff-ab66-0faee923635a,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,×williamsii,Viola ×williamsii,29906970_65415246_eol-full-size-copy.jpg,29906970,65415246,d856aa69bcd7a9cbadf413cc1768890d,https://upload.wikimedia.org/wikipedia/commons/8/8b/Hornveilchen_(Viola_cornuta).jpg,https://content.eol.org/data/media/59/dc/d7/509.6e24c841c1b3d4d135261a2937875d2e.jpg,cc-by-sa-3.0,Burkhard Mücke,https://creativecommons.org/licenses/by-sa/3.0,not provided
|
| 12 |
+
5130cae7-5e42-4552-a174-50339578b7b5,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,wittrockiana,hybrid violet,8757071_49951271_eol-full-size-copy.jpg,8757071,49951271,7f1dc988b86f3817727e4a90682198fc,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0709/2192.jpeg,https://content.eol.org/data/media/86/4d/b2/7.CalPhotos_0000_0000_0709_2192.jpg,cc-publicdomain,2009 Nick Kurzenko,https://creativecommons.org/publicdomain/zero/1.0,not provided
|
| 13 |
+
ebd8860b-3713-4830-9fa0-5a56678a2c75,Animalia,Arthropoda,Insecta,Lepidoptera,Hesperiidae,Viola,wittrockiana,hybrid violet,8757019_49951271_eol-full-size-copy.jpg,8757019,49951271,80b58d1dbaab016965ded4902317ed37,http://calphotos.berkeley.edu/imgs/512x768/0000_0000/0606/1345.jpeg,https://content.eol.org/data/media/86/0f/f4/7.CalPhotos_0000_0000_0606_1345.jpg,cc-publicdomain,2006 Nick Kurzenko,https://creativecommons.org/publicdomain/zero/1.0,not provided
|
data/taxa_files/sample_arthropoda_mislabels.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
8757071_49951271_eol-full-size-copy.jpg
|
| 2 |
+
20507360_64639770_eol-full-size-copy.jpg
|
| 3 |
+
8757019_49951271_eol-full-size-copy.jpg
|
| 4 |
+
8792002_49952170_eol-full-size-copy.jpg
|
| 5 |
+
8757102_49951271_eol-full-size-copy.jpg
|
| 6 |
+
8757093_49951271_eol-full-size-copy.jpg
|
| 7 |
+
30038365_65415248_eol-full-size-copy.jpg
|
| 8 |
+
29906970_65415246_eol-full-size-copy.jpg
|
| 9 |
+
8791997_49952170_eol-full-size-copy.jpg
|
| 10 |
+
8922943_49955771_eol-full-size-copy.jpg
|
| 11 |
+
29907020_65415246_eol-full-size-copy.jpg
|
| 12 |
+
22255430_64639830_eol-full-size-copy.jpg
|
data/taxa_files/sample_images/20507360_64639770_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/22255430_64639830_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/29906970_65415246_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/29907020_65415246_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/30038365_65415248_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8757019_49951271_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8757071_49951271_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8757093_49951271_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8757102_49951271_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8791997_49952170_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8792002_49952170_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
data/taxa_files/sample_images/8922943_49955771_eol-full-size-copy.jpg
ADDED
|
Git LFS Details
|
notebooks/make_ToL_hybrids_Arthropoda_EDA.ipynb
ADDED
|
@@ -0,0 +1,1675 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [],
|
| 8 |
+
"source": [
|
| 9 |
+
"import pandas as pd\n",
|
| 10 |
+
"import seaborn as sns\n",
|
| 11 |
+
"\n",
|
| 12 |
+
"sns.set_style(\"whitegrid\")"
|
| 13 |
+
]
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"cell_type": "markdown",
|
| 17 |
+
"metadata": {},
|
| 18 |
+
"source": [
|
| 19 |
+
"Read in our TreeOfLife-10M Catalog to check for hybrid stats. Note that it can be found [here](https://huggingface.co/datasets/imageomics/ToL-EDA/blob/main/data/catalog.csv) and will not be reproduced on GitHub."
|
| 20 |
+
]
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"cell_type": "code",
|
| 24 |
+
"execution_count": 2,
|
| 25 |
+
"metadata": {},
|
| 26 |
+
"outputs": [],
|
| 27 |
+
"source": [
|
| 28 |
+
"DATA_PATH = \"../data/\""
|
| 29 |
+
]
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"cell_type": "code",
|
| 33 |
+
"execution_count": 3,
|
| 34 |
+
"metadata": {},
|
| 35 |
+
"outputs": [],
|
| 36 |
+
"source": [
|
| 37 |
+
"df = pd.read_csv(DATA_PATH + \"catalog.csv\", low_memory = False)"
|
| 38 |
+
]
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"cell_type": "markdown",
|
| 42 |
+
"metadata": {},
|
| 43 |
+
"source": [
|
| 44 |
+
"The `train_small` column is duplicates of `train`, so we will drop those to analyze the full training set plus val."
|
| 45 |
+
]
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"cell_type": "code",
|
| 49 |
+
"execution_count": 4,
|
| 50 |
+
"metadata": {},
|
| 51 |
+
"outputs": [],
|
| 52 |
+
"source": [
|
| 53 |
+
"df = df.loc[df.split != 'train_small']"
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"cell_type": "code",
|
| 58 |
+
"execution_count": 5,
|
| 59 |
+
"metadata": {},
|
| 60 |
+
"outputs": [
|
| 61 |
+
{
|
| 62 |
+
"data": {
|
| 63 |
+
"text/plain": [
|
| 64 |
+
"194"
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
"execution_count": 5,
|
| 68 |
+
"metadata": {},
|
| 69 |
+
"output_type": "execute_result"
|
| 70 |
+
}
|
| 71 |
+
],
|
| 72 |
+
"source": [
|
| 73 |
+
"hybrid_list = [species for species in list(df.loc[df[\"species\"].notna(), \"species\"].unique()) if \" x \" in species]\n",
|
| 74 |
+
"len(hybrid_list)"
|
| 75 |
+
]
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"cell_type": "code",
|
| 79 |
+
"execution_count": 6,
|
| 80 |
+
"metadata": {},
|
| 81 |
+
"outputs": [
|
| 82 |
+
{
|
| 83 |
+
"data": {
|
| 84 |
+
"text/html": [
|
| 85 |
+
"<div>\n",
|
| 86 |
+
"<style scoped>\n",
|
| 87 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 88 |
+
" vertical-align: middle;\n",
|
| 89 |
+
" }\n",
|
| 90 |
+
"\n",
|
| 91 |
+
" .dataframe tbody tr th {\n",
|
| 92 |
+
" vertical-align: top;\n",
|
| 93 |
+
" }\n",
|
| 94 |
+
"\n",
|
| 95 |
+
" .dataframe thead th {\n",
|
| 96 |
+
" text-align: right;\n",
|
| 97 |
+
" }\n",
|
| 98 |
+
"</style>\n",
|
| 99 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 100 |
+
" <thead>\n",
|
| 101 |
+
" <tr style=\"text-align: right;\">\n",
|
| 102 |
+
" <th></th>\n",
|
| 103 |
+
" <th>split</th>\n",
|
| 104 |
+
" <th>treeoflife_id</th>\n",
|
| 105 |
+
" <th>eol_content_id</th>\n",
|
| 106 |
+
" <th>eol_page_id</th>\n",
|
| 107 |
+
" <th>bioscan_part</th>\n",
|
| 108 |
+
" <th>bioscan_filename</th>\n",
|
| 109 |
+
" <th>inat21_filename</th>\n",
|
| 110 |
+
" <th>inat21_cls_name</th>\n",
|
| 111 |
+
" <th>inat21_cls_num</th>\n",
|
| 112 |
+
" <th>kingdom</th>\n",
|
| 113 |
+
" <th>phylum</th>\n",
|
| 114 |
+
" <th>class</th>\n",
|
| 115 |
+
" <th>order</th>\n",
|
| 116 |
+
" <th>family</th>\n",
|
| 117 |
+
" <th>genus</th>\n",
|
| 118 |
+
" <th>species</th>\n",
|
| 119 |
+
" <th>common</th>\n",
|
| 120 |
+
" </tr>\n",
|
| 121 |
+
" </thead>\n",
|
| 122 |
+
" <tbody>\n",
|
| 123 |
+
" <tr>\n",
|
| 124 |
+
" <th>2240145</th>\n",
|
| 125 |
+
" <td>train</td>\n",
|
| 126 |
+
" <td>adb05f6d-5203-4c35-b492-78cd9f787fdf</td>\n",
|
| 127 |
+
" <td>14781541.0</td>\n",
|
| 128 |
+
" <td>64426054.0</td>\n",
|
| 129 |
+
" <td>NaN</td>\n",
|
| 130 |
+
" <td>NaN</td>\n",
|
| 131 |
+
" <td>NaN</td>\n",
|
| 132 |
+
" <td>NaN</td>\n",
|
| 133 |
+
" <td>NaN</td>\n",
|
| 134 |
+
" <td>Plantae</td>\n",
|
| 135 |
+
" <td>Tracheophyta</td>\n",
|
| 136 |
+
" <td>Magnoliopsida</td>\n",
|
| 137 |
+
" <td>Asterales</td>\n",
|
| 138 |
+
" <td>Asteraceae</td>\n",
|
| 139 |
+
" <td>Aster</td>\n",
|
| 140 |
+
" <td>novi-belgii x lanceolatus =</td>\n",
|
| 141 |
+
" <td>Aster novi-belgii x lanceolatus =</td>\n",
|
| 142 |
+
" </tr>\n",
|
| 143 |
+
" <tr>\n",
|
| 144 |
+
" <th>3722542</th>\n",
|
| 145 |
+
" <td>train</td>\n",
|
| 146 |
+
" <td>1a5ace13-3c10-4053-9578-8ef08bac2014</td>\n",
|
| 147 |
+
" <td>14781535.0</td>\n",
|
| 148 |
+
" <td>64426054.0</td>\n",
|
| 149 |
+
" <td>NaN</td>\n",
|
| 150 |
+
" <td>NaN</td>\n",
|
| 151 |
+
" <td>NaN</td>\n",
|
| 152 |
+
" <td>NaN</td>\n",
|
| 153 |
+
" <td>NaN</td>\n",
|
| 154 |
+
" <td>Plantae</td>\n",
|
| 155 |
+
" <td>Tracheophyta</td>\n",
|
| 156 |
+
" <td>Magnoliopsida</td>\n",
|
| 157 |
+
" <td>Asterales</td>\n",
|
| 158 |
+
" <td>Asteraceae</td>\n",
|
| 159 |
+
" <td>Aster</td>\n",
|
| 160 |
+
" <td>novi-belgii x lanceolatus =</td>\n",
|
| 161 |
+
" <td>Aster novi-belgii x lanceolatus =</td>\n",
|
| 162 |
+
" </tr>\n",
|
| 163 |
+
" <tr>\n",
|
| 164 |
+
" <th>1506130</th>\n",
|
| 165 |
+
" <td>train</td>\n",
|
| 166 |
+
" <td>cc38fb4f-80c7-456f-b0b6-d7d41445d050</td>\n",
|
| 167 |
+
" <td>14826040.0</td>\n",
|
| 168 |
+
" <td>64426000.0</td>\n",
|
| 169 |
+
" <td>NaN</td>\n",
|
| 170 |
+
" <td>NaN</td>\n",
|
| 171 |
+
" <td>NaN</td>\n",
|
| 172 |
+
" <td>NaN</td>\n",
|
| 173 |
+
" <td>NaN</td>\n",
|
| 174 |
+
" <td>Plantae</td>\n",
|
| 175 |
+
" <td>Tracheophyta</td>\n",
|
| 176 |
+
" <td>Magnoliopsida</td>\n",
|
| 177 |
+
" <td>Caryophyllales</td>\n",
|
| 178 |
+
" <td>Droseraceae</td>\n",
|
| 179 |
+
" <td>Drosera</td>\n",
|
| 180 |
+
" <td>rotundifolia x intermedia =</td>\n",
|
| 181 |
+
" <td>Drosera rotundifolia x intermedia =</td>\n",
|
| 182 |
+
" </tr>\n",
|
| 183 |
+
" <tr>\n",
|
| 184 |
+
" <th>3868943</th>\n",
|
| 185 |
+
" <td>train</td>\n",
|
| 186 |
+
" <td>bb75e112-3267-4471-baaa-dd037e5a89b0</td>\n",
|
| 187 |
+
" <td>10828404.0</td>\n",
|
| 188 |
+
" <td>56745261.0</td>\n",
|
| 189 |
+
" <td>NaN</td>\n",
|
| 190 |
+
" <td>NaN</td>\n",
|
| 191 |
+
" <td>NaN</td>\n",
|
| 192 |
+
" <td>NaN</td>\n",
|
| 193 |
+
" <td>NaN</td>\n",
|
| 194 |
+
" <td>Plantae</td>\n",
|
| 195 |
+
" <td>Tracheophyta</td>\n",
|
| 196 |
+
" <td>Magnoliopsida</td>\n",
|
| 197 |
+
" <td>Brassicales</td>\n",
|
| 198 |
+
" <td>Brassicaceae</td>\n",
|
| 199 |
+
" <td>Rorippa</td>\n",
|
| 200 |
+
" <td>austriaca x sylvestris</td>\n",
|
| 201 |
+
" <td>Rorippa austriaca x sylvestris</td>\n",
|
| 202 |
+
" </tr>\n",
|
| 203 |
+
" </tbody>\n",
|
| 204 |
+
"</table>\n",
|
| 205 |
+
"</div>"
|
| 206 |
+
],
|
| 207 |
+
"text/plain": [
|
| 208 |
+
" split treeoflife_id eol_content_id \\\n",
|
| 209 |
+
"2240145 train adb05f6d-5203-4c35-b492-78cd9f787fdf 14781541.0 \n",
|
| 210 |
+
"3722542 train 1a5ace13-3c10-4053-9578-8ef08bac2014 14781535.0 \n",
|
| 211 |
+
"1506130 train cc38fb4f-80c7-456f-b0b6-d7d41445d050 14826040.0 \n",
|
| 212 |
+
"3868943 train bb75e112-3267-4471-baaa-dd037e5a89b0 10828404.0 \n",
|
| 213 |
+
"\n",
|
| 214 |
+
" eol_page_id bioscan_part bioscan_filename inat21_filename \\\n",
|
| 215 |
+
"2240145 64426054.0 NaN NaN NaN \n",
|
| 216 |
+
"3722542 64426054.0 NaN NaN NaN \n",
|
| 217 |
+
"1506130 64426000.0 NaN NaN NaN \n",
|
| 218 |
+
"3868943 56745261.0 NaN NaN NaN \n",
|
| 219 |
+
"\n",
|
| 220 |
+
" inat21_cls_name inat21_cls_num kingdom phylum class \\\n",
|
| 221 |
+
"2240145 NaN NaN Plantae Tracheophyta Magnoliopsida \n",
|
| 222 |
+
"3722542 NaN NaN Plantae Tracheophyta Magnoliopsida \n",
|
| 223 |
+
"1506130 NaN NaN Plantae Tracheophyta Magnoliopsida \n",
|
| 224 |
+
"3868943 NaN NaN Plantae Tracheophyta Magnoliopsida \n",
|
| 225 |
+
"\n",
|
| 226 |
+
" order family genus species \\\n",
|
| 227 |
+
"2240145 Asterales Asteraceae Aster novi-belgii x lanceolatus = \n",
|
| 228 |
+
"3722542 Asterales Asteraceae Aster novi-belgii x lanceolatus = \n",
|
| 229 |
+
"1506130 Caryophyllales Droseraceae Drosera rotundifolia x intermedia = \n",
|
| 230 |
+
"3868943 Brassicales Brassicaceae Rorippa austriaca x sylvestris \n",
|
| 231 |
+
"\n",
|
| 232 |
+
" common \n",
|
| 233 |
+
"2240145 Aster novi-belgii x lanceolatus = \n",
|
| 234 |
+
"3722542 Aster novi-belgii x lanceolatus = \n",
|
| 235 |
+
"1506130 Drosera rotundifolia x intermedia = \n",
|
| 236 |
+
"3868943 Rorippa austriaca x sylvestris "
|
| 237 |
+
]
|
| 238 |
+
},
|
| 239 |
+
"execution_count": 6,
|
| 240 |
+
"metadata": {},
|
| 241 |
+
"output_type": "execute_result"
|
| 242 |
+
}
|
| 243 |
+
],
|
| 244 |
+
"source": [
|
| 245 |
+
"df.loc[df[\"species\"].isin(hybrid_list)].sample(4)"
|
| 246 |
+
]
|
| 247 |
+
},
|
| 248 |
+
{
|
| 249 |
+
"cell_type": "code",
|
| 250 |
+
"execution_count": 7,
|
| 251 |
+
"metadata": {},
|
| 252 |
+
"outputs": [
|
| 253 |
+
{
|
| 254 |
+
"name": "stdout",
|
| 255 |
+
"output_type": "stream",
|
| 256 |
+
"text": [
|
| 257 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 258 |
+
"Index: 1146 entries, 967163 to 10968858\n",
|
| 259 |
+
"Data columns (total 17 columns):\n",
|
| 260 |
+
" # Column Non-Null Count Dtype \n",
|
| 261 |
+
"--- ------ -------------- ----- \n",
|
| 262 |
+
" 0 split 1146 non-null object \n",
|
| 263 |
+
" 1 treeoflife_id 1146 non-null object \n",
|
| 264 |
+
" 2 eol_content_id 1146 non-null float64\n",
|
| 265 |
+
" 3 eol_page_id 1146 non-null float64\n",
|
| 266 |
+
" 4 bioscan_part 0 non-null float64\n",
|
| 267 |
+
" 5 bioscan_filename 0 non-null object \n",
|
| 268 |
+
" 6 inat21_filename 0 non-null object \n",
|
| 269 |
+
" 7 inat21_cls_name 0 non-null object \n",
|
| 270 |
+
" 8 inat21_cls_num 0 non-null float64\n",
|
| 271 |
+
" 9 kingdom 851 non-null object \n",
|
| 272 |
+
" 10 phylum 851 non-null object \n",
|
| 273 |
+
" 11 class 851 non-null object \n",
|
| 274 |
+
" 12 order 851 non-null object \n",
|
| 275 |
+
" 13 family 855 non-null object \n",
|
| 276 |
+
" 14 genus 1146 non-null object \n",
|
| 277 |
+
" 15 species 1146 non-null object \n",
|
| 278 |
+
" 16 common 1146 non-null object \n",
|
| 279 |
+
"dtypes: float64(4), object(13)\n",
|
| 280 |
+
"memory usage: 161.2+ KB\n"
|
| 281 |
+
]
|
| 282 |
+
}
|
| 283 |
+
],
|
| 284 |
+
"source": [
|
| 285 |
+
"df.loc[df[\"species\"].isin(hybrid_list)].info(show_counts = True)"
|
| 286 |
+
]
|
| 287 |
+
},
|
| 288 |
+
{
|
| 289 |
+
"cell_type": "markdown",
|
| 290 |
+
"metadata": {},
|
| 291 |
+
"source": [
|
| 292 |
+
"It looks like there are 1,146 hybrids which are all labeled at the genus level, and most (~850) have full taxonomic rank. They are _**all**_ from EOL (as expected).\n",
|
| 293 |
+
"\n",
|
| 294 |
+
"Let's get a better picture of the overall diversity, then we can reduced down the dataset."
|
| 295 |
+
]
|
| 296 |
+
},
|
| 297 |
+
{
|
| 298 |
+
"cell_type": "code",
|
| 299 |
+
"execution_count": 8,
|
| 300 |
+
"metadata": {},
|
| 301 |
+
"outputs": [
|
| 302 |
+
{
|
| 303 |
+
"data": {
|
| 304 |
+
"text/plain": [
|
| 305 |
+
"split 2\n",
|
| 306 |
+
"treeoflife_id 1146\n",
|
| 307 |
+
"eol_content_id 1146\n",
|
| 308 |
+
"eol_page_id 198\n",
|
| 309 |
+
"bioscan_part 0\n",
|
| 310 |
+
"bioscan_filename 0\n",
|
| 311 |
+
"inat21_filename 0\n",
|
| 312 |
+
"inat21_cls_name 0\n",
|
| 313 |
+
"inat21_cls_num 0\n",
|
| 314 |
+
"kingdom 2\n",
|
| 315 |
+
"phylum 3\n",
|
| 316 |
+
"class 8\n",
|
| 317 |
+
"order 33\n",
|
| 318 |
+
"family 55\n",
|
| 319 |
+
"genus 119\n",
|
| 320 |
+
"species 194\n",
|
| 321 |
+
"common 196\n",
|
| 322 |
+
"dtype: int64"
|
| 323 |
+
]
|
| 324 |
+
},
|
| 325 |
+
"execution_count": 8,
|
| 326 |
+
"metadata": {},
|
| 327 |
+
"output_type": "execute_result"
|
| 328 |
+
}
|
| 329 |
+
],
|
| 330 |
+
"source": [
|
| 331 |
+
"df.loc[df[\"species\"].isin(hybrid_list)].nunique()"
|
| 332 |
+
]
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"cell_type": "code",
|
| 336 |
+
"execution_count": 9,
|
| 337 |
+
"metadata": {},
|
| 338 |
+
"outputs": [
|
| 339 |
+
{
|
| 340 |
+
"name": "stdout",
|
| 341 |
+
"output_type": "stream",
|
| 342 |
+
"text": [
|
| 343 |
+
"kingdom\n",
|
| 344 |
+
"Plantae 804\n",
|
| 345 |
+
"Animalia 47\n",
|
| 346 |
+
"Name: count, dtype: int64\n",
|
| 347 |
+
"\n",
|
| 348 |
+
"phylum\n",
|
| 349 |
+
"Tracheophyta 804\n",
|
| 350 |
+
"Mollusca 32\n",
|
| 351 |
+
"Chordata 15\n",
|
| 352 |
+
"Name: count, dtype: int64\n",
|
| 353 |
+
"\n",
|
| 354 |
+
"class\n",
|
| 355 |
+
"Magnoliopsida 746\n",
|
| 356 |
+
"Polypodiopsida 53\n",
|
| 357 |
+
"Gastropoda 32\n",
|
| 358 |
+
"Reptilia 6\n",
|
| 359 |
+
"Pinopsida 5\n",
|
| 360 |
+
"Teleostei 4\n",
|
| 361 |
+
"Aves 3\n",
|
| 362 |
+
"Mammalia 2\n",
|
| 363 |
+
"Name: count, dtype: int64\n",
|
| 364 |
+
"\n"
|
| 365 |
+
]
|
| 366 |
+
}
|
| 367 |
+
],
|
| 368 |
+
"source": [
|
| 369 |
+
"for taxa in [\"kingdom\", \"phylum\", \"class\"]:\n",
|
| 370 |
+
" print(df.loc[df[\"species\"].isin(hybrid_list), taxa].value_counts())\n",
|
| 371 |
+
" print()"
|
| 372 |
+
]
|
| 373 |
+
},
|
| 374 |
+
{
|
| 375 |
+
"cell_type": "markdown",
|
| 376 |
+
"metadata": {},
|
| 377 |
+
"source": [
|
| 378 |
+
"The vast majority of our hybrids here are plants.\n",
|
| 379 |
+
"\n",
|
| 380 |
+
"Let's reduce the dataset down to only images in the genera for which we have hybrids (since they're all labeled at that level), then we'll save that CSV and run some more information through."
|
| 381 |
+
]
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"cell_type": "code",
|
| 385 |
+
"execution_count": 10,
|
| 386 |
+
"metadata": {},
|
| 387 |
+
"outputs": [
|
| 388 |
+
{
|
| 389 |
+
"data": {
|
| 390 |
+
"text/plain": [
|
| 391 |
+
"119"
|
| 392 |
+
]
|
| 393 |
+
},
|
| 394 |
+
"execution_count": 10,
|
| 395 |
+
"metadata": {},
|
| 396 |
+
"output_type": "execute_result"
|
| 397 |
+
}
|
| 398 |
+
],
|
| 399 |
+
"source": [
|
| 400 |
+
"hybrid_genera = [genus for genus in list(df.loc[df[\"species\"].isin(hybrid_list), \"genus\"].unique())]\n",
|
| 401 |
+
"len(hybrid_genera)"
|
| 402 |
+
]
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"cell_type": "code",
|
| 406 |
+
"execution_count": 11,
|
| 407 |
+
"metadata": {},
|
| 408 |
+
"outputs": [
|
| 409 |
+
{
|
| 410 |
+
"name": "stdout",
|
| 411 |
+
"output_type": "stream",
|
| 412 |
+
"text": [
|
| 413 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 414 |
+
"Index: 415870 entries, 956721 to 11021624\n",
|
| 415 |
+
"Data columns (total 17 columns):\n",
|
| 416 |
+
" # Column Non-Null Count Dtype \n",
|
| 417 |
+
"--- ------ -------------- ----- \n",
|
| 418 |
+
" 0 split 415870 non-null object \n",
|
| 419 |
+
" 1 treeoflife_id 415870 non-null object \n",
|
| 420 |
+
" 2 eol_content_id 261349 non-null float64\n",
|
| 421 |
+
" 3 eol_page_id 261349 non-null float64\n",
|
| 422 |
+
" 4 bioscan_part 0 non-null float64\n",
|
| 423 |
+
" 5 bioscan_filename 0 non-null object \n",
|
| 424 |
+
" 6 inat21_filename 154521 non-null object \n",
|
| 425 |
+
" 7 inat21_cls_name 154521 non-null object \n",
|
| 426 |
+
" 8 inat21_cls_num 154521 non-null float64\n",
|
| 427 |
+
" 9 kingdom 413726 non-null object \n",
|
| 428 |
+
" 10 phylum 413726 non-null object \n",
|
| 429 |
+
" 11 class 413726 non-null object \n",
|
| 430 |
+
" 12 order 413632 non-null object \n",
|
| 431 |
+
" 13 family 413815 non-null object \n",
|
| 432 |
+
" 14 genus 415870 non-null object \n",
|
| 433 |
+
" 15 species 409804 non-null object \n",
|
| 434 |
+
" 16 common 415870 non-null object \n",
|
| 435 |
+
"dtypes: float64(4), object(13)\n",
|
| 436 |
+
"memory usage: 57.1+ MB\n"
|
| 437 |
+
]
|
| 438 |
+
}
|
| 439 |
+
],
|
| 440 |
+
"source": [
|
| 441 |
+
"hybrid_catalog = df.loc[df[\"genus\"].isin(hybrid_genera)]\n",
|
| 442 |
+
"hybrid_catalog.info(show_counts = True)"
|
| 443 |
+
]
|
| 444 |
+
},
|
| 445 |
+
{
|
| 446 |
+
"cell_type": "markdown",
|
| 447 |
+
"metadata": {},
|
| 448 |
+
"source": [
|
| 449 |
+
"We have almost 416K images to represent the genera for which we have 1,146 images of 194 different hybrids. These images are from both EOL and iNat21. Since we can't redistribute iNat21 images, we will have to remove the 155K there."
|
| 450 |
+
]
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"cell_type": "code",
|
| 454 |
+
"execution_count": 12,
|
| 455 |
+
"metadata": {},
|
| 456 |
+
"outputs": [
|
| 457 |
+
{
|
| 458 |
+
"name": "stdout",
|
| 459 |
+
"output_type": "stream",
|
| 460 |
+
"text": [
|
| 461 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 462 |
+
"Index: 261349 entries, 956721 to 11000930\n",
|
| 463 |
+
"Data columns (total 17 columns):\n",
|
| 464 |
+
" # Column Non-Null Count Dtype \n",
|
| 465 |
+
"--- ------ -------------- ----- \n",
|
| 466 |
+
" 0 split 261349 non-null object \n",
|
| 467 |
+
" 1 treeoflife_id 261349 non-null object \n",
|
| 468 |
+
" 2 eol_content_id 261349 non-null float64\n",
|
| 469 |
+
" 3 eol_page_id 261349 non-null float64\n",
|
| 470 |
+
" 4 bioscan_part 0 non-null float64\n",
|
| 471 |
+
" 5 bioscan_filename 0 non-null object \n",
|
| 472 |
+
" 6 inat21_filename 0 non-null object \n",
|
| 473 |
+
" 7 inat21_cls_name 0 non-null object \n",
|
| 474 |
+
" 8 inat21_cls_num 0 non-null float64\n",
|
| 475 |
+
" 9 kingdom 259205 non-null object \n",
|
| 476 |
+
" 10 phylum 259205 non-null object \n",
|
| 477 |
+
" 11 class 259205 non-null object \n",
|
| 478 |
+
" 12 order 259111 non-null object \n",
|
| 479 |
+
" 13 family 259294 non-null object \n",
|
| 480 |
+
" 14 genus 261349 non-null object \n",
|
| 481 |
+
" 15 species 255283 non-null object \n",
|
| 482 |
+
" 16 common 261349 non-null object \n",
|
| 483 |
+
"dtypes: float64(4), object(13)\n",
|
| 484 |
+
"memory usage: 35.9+ MB\n"
|
| 485 |
+
]
|
| 486 |
+
}
|
| 487 |
+
],
|
| 488 |
+
"source": [
|
| 489 |
+
"eol_hybrid_catalog = hybrid_catalog.loc[hybrid_catalog[\"eol_content_id\"].notna()]\n",
|
| 490 |
+
"eol_hybrid_catalog.info(show_counts = True)"
|
| 491 |
+
]
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"cell_type": "markdown",
|
| 495 |
+
"metadata": {},
|
| 496 |
+
"source": [
|
| 497 |
+
"So we have about 261K images.\n",
|
| 498 |
+
"\n",
|
| 499 |
+
"Remove extra columns and save to CSV for further analysis."
|
| 500 |
+
]
|
| 501 |
+
},
|
| 502 |
+
{
|
| 503 |
+
"cell_type": "code",
|
| 504 |
+
"execution_count": 13,
|
| 505 |
+
"metadata": {},
|
| 506 |
+
"outputs": [
|
| 507 |
+
{
|
| 508 |
+
"data": {
|
| 509 |
+
"text/plain": [
|
| 510 |
+
"['treeoflife_id',\n",
|
| 511 |
+
" 'eol_content_id',\n",
|
| 512 |
+
" 'eol_page_id',\n",
|
| 513 |
+
" 'kingdom',\n",
|
| 514 |
+
" 'phylum',\n",
|
| 515 |
+
" 'class',\n",
|
| 516 |
+
" 'order',\n",
|
| 517 |
+
" 'family',\n",
|
| 518 |
+
" 'genus',\n",
|
| 519 |
+
" 'species',\n",
|
| 520 |
+
" 'common']"
|
| 521 |
+
]
|
| 522 |
+
},
|
| 523 |
+
"execution_count": 13,
|
| 524 |
+
"metadata": {},
|
| 525 |
+
"output_type": "execute_result"
|
| 526 |
+
}
|
| 527 |
+
],
|
| 528 |
+
"source": [
|
| 529 |
+
"cols_to_keep = [col for col in list(eol_hybrid_catalog.columns)[1:] if col not in list(eol_hybrid_catalog.columns)[4:9]]\n",
|
| 530 |
+
"cols_to_keep"
|
| 531 |
+
]
|
| 532 |
+
},
|
| 533 |
+
{
|
| 534 |
+
"cell_type": "code",
|
| 535 |
+
"execution_count": 14,
|
| 536 |
+
"metadata": {},
|
| 537 |
+
"outputs": [],
|
| 538 |
+
"source": [
|
| 539 |
+
"eol_hybrid_catalog = eol_hybrid_catalog[cols_to_keep]"
|
| 540 |
+
]
|
| 541 |
+
},
|
| 542 |
+
{
|
| 543 |
+
"cell_type": "code",
|
| 544 |
+
"execution_count": 15,
|
| 545 |
+
"metadata": {},
|
| 546 |
+
"outputs": [
|
| 547 |
+
{
|
| 548 |
+
"name": "stdout",
|
| 549 |
+
"output_type": "stream",
|
| 550 |
+
"text": [
|
| 551 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 552 |
+
"Index: 261349 entries, 956721 to 11000930\n",
|
| 553 |
+
"Data columns (total 11 columns):\n",
|
| 554 |
+
" # Column Non-Null Count Dtype \n",
|
| 555 |
+
"--- ------ -------------- ----- \n",
|
| 556 |
+
" 0 treeoflife_id 261349 non-null object \n",
|
| 557 |
+
" 1 eol_content_id 261349 non-null float64\n",
|
| 558 |
+
" 2 eol_page_id 261349 non-null float64\n",
|
| 559 |
+
" 3 kingdom 259205 non-null object \n",
|
| 560 |
+
" 4 phylum 259205 non-null object \n",
|
| 561 |
+
" 5 class 259205 non-null object \n",
|
| 562 |
+
" 6 order 259111 non-null object \n",
|
| 563 |
+
" 7 family 259294 non-null object \n",
|
| 564 |
+
" 8 genus 261349 non-null object \n",
|
| 565 |
+
" 9 species 255283 non-null object \n",
|
| 566 |
+
" 10 common 261349 non-null object \n",
|
| 567 |
+
"dtypes: float64(2), object(9)\n",
|
| 568 |
+
"memory usage: 23.9+ MB\n"
|
| 569 |
+
]
|
| 570 |
+
}
|
| 571 |
+
],
|
| 572 |
+
"source": [
|
| 573 |
+
"eol_hybrid_catalog.info()"
|
| 574 |
+
]
|
| 575 |
+
},
|
| 576 |
+
{
|
| 577 |
+
"cell_type": "code",
|
| 578 |
+
"execution_count": 16,
|
| 579 |
+
"metadata": {},
|
| 580 |
+
"outputs": [
|
| 581 |
+
{
|
| 582 |
+
"data": {
|
| 583 |
+
"text/plain": [
|
| 584 |
+
"treeoflife_id 261349\n",
|
| 585 |
+
"eol_content_id 261349\n",
|
| 586 |
+
"eol_page_id 13577\n",
|
| 587 |
+
"kingdom 3\n",
|
| 588 |
+
"phylum 5\n",
|
| 589 |
+
"class 13\n",
|
| 590 |
+
"order 43\n",
|
| 591 |
+
"family 73\n",
|
| 592 |
+
"genus 119\n",
|
| 593 |
+
"species 8331\n",
|
| 594 |
+
"common 10927\n",
|
| 595 |
+
"dtype: int64"
|
| 596 |
+
]
|
| 597 |
+
},
|
| 598 |
+
"execution_count": 16,
|
| 599 |
+
"metadata": {},
|
| 600 |
+
"output_type": "execute_result"
|
| 601 |
+
}
|
| 602 |
+
],
|
| 603 |
+
"source": [
|
| 604 |
+
"eol_hybrid_catalog.nunique()"
|
| 605 |
+
]
|
| 606 |
+
},
|
| 607 |
+
{
|
| 608 |
+
"cell_type": "code",
|
| 609 |
+
"execution_count": 17,
|
| 610 |
+
"metadata": {},
|
| 611 |
+
"outputs": [
|
| 612 |
+
{
|
| 613 |
+
"data": {
|
| 614 |
+
"text/plain": [
|
| 615 |
+
"kingdom\n",
|
| 616 |
+
"Plantae 236711\n",
|
| 617 |
+
"Animalia 22471\n",
|
| 618 |
+
"Protozoa 23\n",
|
| 619 |
+
"Name: count, dtype: int64"
|
| 620 |
+
]
|
| 621 |
+
},
|
| 622 |
+
"execution_count": 17,
|
| 623 |
+
"metadata": {},
|
| 624 |
+
"output_type": "execute_result"
|
| 625 |
+
}
|
| 626 |
+
],
|
| 627 |
+
"source": [
|
| 628 |
+
"eol_hybrid_catalog.kingdom.value_counts()"
|
| 629 |
+
]
|
| 630 |
+
},
|
| 631 |
+
{
|
| 632 |
+
"cell_type": "code",
|
| 633 |
+
"execution_count": 18,
|
| 634 |
+
"metadata": {},
|
| 635 |
+
"outputs": [
|
| 636 |
+
{
|
| 637 |
+
"data": {
|
| 638 |
+
"text/plain": [
|
| 639 |
+
"treeoflife_id 23\n",
|
| 640 |
+
"eol_content_id 23\n",
|
| 641 |
+
"eol_page_id 5\n",
|
| 642 |
+
"kingdom 1\n",
|
| 643 |
+
"phylum 1\n",
|
| 644 |
+
"class 2\n",
|
| 645 |
+
"order 2\n",
|
| 646 |
+
"family 1\n",
|
| 647 |
+
"genus 1\n",
|
| 648 |
+
"species 3\n",
|
| 649 |
+
"common 4\n",
|
| 650 |
+
"dtype: int64"
|
| 651 |
+
]
|
| 652 |
+
},
|
| 653 |
+
"execution_count": 18,
|
| 654 |
+
"metadata": {},
|
| 655 |
+
"output_type": "execute_result"
|
| 656 |
+
}
|
| 657 |
+
],
|
| 658 |
+
"source": [
|
| 659 |
+
"eol_hybrid_catalog.loc[eol_hybrid_catalog[\"kingdom\"] == \"Protozoa\"].nunique()"
|
| 660 |
+
]
|
| 661 |
+
},
|
| 662 |
+
{
|
| 663 |
+
"cell_type": "markdown",
|
| 664 |
+
"metadata": {},
|
| 665 |
+
"source": [
|
| 666 |
+
"Check for these species as parent species."
|
| 667 |
+
]
|
| 668 |
+
},
|
| 669 |
+
{
|
| 670 |
+
"cell_type": "code",
|
| 671 |
+
"execution_count": 19,
|
| 672 |
+
"metadata": {},
|
| 673 |
+
"outputs": [],
|
| 674 |
+
"source": [
|
| 675 |
+
"protazoa = [species for species in list(eol_hybrid_catalog.loc[eol_hybrid_catalog[\"kingdom\"] == \"Protozoa\", \"species\"].dropna().unique())]\n",
|
| 676 |
+
"for species in protazoa:\n",
|
| 677 |
+
" for hybrid in hybrid_list:\n",
|
| 678 |
+
" if str(species) in hybrid:\n",
|
| 679 |
+
" print(species)\n",
|
| 680 |
+
" print(hybrid)"
|
| 681 |
+
]
|
| 682 |
+
},
|
| 683 |
+
{
|
| 684 |
+
"cell_type": "markdown",
|
| 685 |
+
"metadata": {},
|
| 686 |
+
"source": [
|
| 687 |
+
"The parent species added in an additional two phyla and more lower-order ranks. Some of this is a byproduct of homonymy, so we'll reduce down by species name as well.\n",
|
| 688 |
+
"\n",
|
| 689 |
+
"So, we'll actually generate a list of parent species and further pull out these, especially since we've increased our `kingdom` count with a `kingdom` that doesn't have hybrids."
|
| 690 |
+
]
|
| 691 |
+
},
|
| 692 |
+
{
|
| 693 |
+
"cell_type": "code",
|
| 694 |
+
"execution_count": 20,
|
| 695 |
+
"metadata": {},
|
| 696 |
+
"outputs": [
|
| 697 |
+
{
|
| 698 |
+
"data": {
|
| 699 |
+
"text/plain": [
|
| 700 |
+
"8138"
|
| 701 |
+
]
|
| 702 |
+
},
|
| 703 |
+
"execution_count": 20,
|
| 704 |
+
"metadata": {},
|
| 705 |
+
"output_type": "execute_result"
|
| 706 |
+
}
|
| 707 |
+
],
|
| 708 |
+
"source": [
|
| 709 |
+
"full_list_species = list(eol_hybrid_catalog.loc[~eol_hybrid_catalog[\"species\"].isin(hybrid_list), \"species\"].unique())\n",
|
| 710 |
+
"len(full_list_species)"
|
| 711 |
+
]
|
| 712 |
+
},
|
| 713 |
+
{
|
| 714 |
+
"cell_type": "code",
|
| 715 |
+
"execution_count": 21,
|
| 716 |
+
"metadata": {},
|
| 717 |
+
"outputs": [],
|
| 718 |
+
"source": [
|
| 719 |
+
"full_list_species = [str(species) for species in eol_hybrid_catalog.species.dropna().unique()]"
|
| 720 |
+
]
|
| 721 |
+
},
|
| 722 |
+
{
|
| 723 |
+
"cell_type": "code",
|
| 724 |
+
"execution_count": 22,
|
| 725 |
+
"metadata": {},
|
| 726 |
+
"outputs": [
|
| 727 |
+
{
|
| 728 |
+
"data": {
|
| 729 |
+
"text/plain": [
|
| 730 |
+
"['jovis', 'turbinata', 'tetragonum', '×saulii', 'neocaledonica']"
|
| 731 |
+
]
|
| 732 |
+
},
|
| 733 |
+
"execution_count": 22,
|
| 734 |
+
"metadata": {},
|
| 735 |
+
"output_type": "execute_result"
|
| 736 |
+
}
|
| 737 |
+
],
|
| 738 |
+
"source": [
|
| 739 |
+
"full_list_species[:5]"
|
| 740 |
+
]
|
| 741 |
+
},
|
| 742 |
+
{
|
| 743 |
+
"cell_type": "code",
|
| 744 |
+
"execution_count": 23,
|
| 745 |
+
"metadata": {},
|
| 746 |
+
"outputs": [
|
| 747 |
+
{
|
| 748 |
+
"name": "stdout",
|
| 749 |
+
"output_type": "stream",
|
| 750 |
+
"text": [
|
| 751 |
+
"We should have 557 entries for 288 unique parent species.\n"
|
| 752 |
+
]
|
| 753 |
+
}
|
| 754 |
+
],
|
| 755 |
+
"source": [
|
| 756 |
+
"parent_species = []\n",
|
| 757 |
+
"for species in full_list_species:\n",
|
| 758 |
+
" for hybrid in hybrid_list:\n",
|
| 759 |
+
" if f\"{str(species)} \" in hybrid or f\" {str(species)}\" in hybrid:\n",
|
| 760 |
+
" parent_species.append(str(species))\n",
|
| 761 |
+
"\n",
|
| 762 |
+
"print(f\"We should have {len(parent_species)} entries for {len(set(parent_species))} unique parent species.\")"
|
| 763 |
+
]
|
| 764 |
+
},
|
| 765 |
+
{
|
| 766 |
+
"cell_type": "code",
|
| 767 |
+
"execution_count": 24,
|
| 768 |
+
"metadata": {},
|
| 769 |
+
"outputs": [
|
| 770 |
+
{
|
| 771 |
+
"name": "stdout",
|
| 772 |
+
"output_type": "stream",
|
| 773 |
+
"text": [
|
| 774 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 775 |
+
"Index: 47124 entries, 956837 to 10998978\n",
|
| 776 |
+
"Data columns (total 11 columns):\n",
|
| 777 |
+
" # Column Non-Null Count Dtype \n",
|
| 778 |
+
"--- ------ -------------- ----- \n",
|
| 779 |
+
" 0 treeoflife_id 47124 non-null object \n",
|
| 780 |
+
" 1 eol_content_id 47124 non-null float64\n",
|
| 781 |
+
" 2 eol_page_id 47124 non-null float64\n",
|
| 782 |
+
" 3 kingdom 46820 non-null object \n",
|
| 783 |
+
" 4 phylum 46820 non-null object \n",
|
| 784 |
+
" 5 class 46820 non-null object \n",
|
| 785 |
+
" 6 order 46814 non-null object \n",
|
| 786 |
+
" 7 family 46824 non-null object \n",
|
| 787 |
+
" 8 genus 47124 non-null object \n",
|
| 788 |
+
" 9 species 47124 non-null object \n",
|
| 789 |
+
" 10 common 47124 non-null object \n",
|
| 790 |
+
"dtypes: float64(2), object(9)\n",
|
| 791 |
+
"memory usage: 4.3+ MB\n"
|
| 792 |
+
]
|
| 793 |
+
}
|
| 794 |
+
],
|
| 795 |
+
"source": [
|
| 796 |
+
"parent_hybrid_cat = eol_hybrid_catalog.loc[(eol_hybrid_catalog[\"species\"].isin(hybrid_list)) | (eol_hybrid_catalog[\"species\"].isin(parent_species))]\n",
|
| 797 |
+
"parent_hybrid_cat.info()"
|
| 798 |
+
]
|
| 799 |
+
},
|
| 800 |
+
{
|
| 801 |
+
"cell_type": "code",
|
| 802 |
+
"execution_count": 25,
|
| 803 |
+
"metadata": {},
|
| 804 |
+
"outputs": [
|
| 805 |
+
{
|
| 806 |
+
"data": {
|
| 807 |
+
"text/plain": [
|
| 808 |
+
"treeoflife_id 47124\n",
|
| 809 |
+
"eol_content_id 47124\n",
|
| 810 |
+
"eol_page_id 1491\n",
|
| 811 |
+
"kingdom 2\n",
|
| 812 |
+
"phylum 4\n",
|
| 813 |
+
"class 11\n",
|
| 814 |
+
"order 41\n",
|
| 815 |
+
"family 70\n",
|
| 816 |
+
"genus 119\n",
|
| 817 |
+
"species 481\n",
|
| 818 |
+
"common 977\n",
|
| 819 |
+
"dtype: int64"
|
| 820 |
+
]
|
| 821 |
+
},
|
| 822 |
+
"execution_count": 25,
|
| 823 |
+
"metadata": {},
|
| 824 |
+
"output_type": "execute_result"
|
| 825 |
+
}
|
| 826 |
+
],
|
| 827 |
+
"source": [
|
| 828 |
+
"parent_hybrid_cat.nunique()"
|
| 829 |
+
]
|
| 830 |
+
},
|
| 831 |
+
{
|
| 832 |
+
"cell_type": "markdown",
|
| 833 |
+
"metadata": {},
|
| 834 |
+
"source": [
|
| 835 |
+
"We still have an extra phyla down, which may be a product of the genera that weren't labled higher being added in, though we should check these extras match with those and aren't homonyms of the others."
|
| 836 |
+
]
|
| 837 |
+
},
|
| 838 |
+
{
|
| 839 |
+
"cell_type": "code",
|
| 840 |
+
"execution_count": 26,
|
| 841 |
+
"metadata": {},
|
| 842 |
+
"outputs": [
|
| 843 |
+
{
|
| 844 |
+
"data": {
|
| 845 |
+
"text/plain": [
|
| 846 |
+
"phylum\n",
|
| 847 |
+
"Tracheophyta 42267\n",
|
| 848 |
+
"Chordata 3861\n",
|
| 849 |
+
"Mollusca 458\n",
|
| 850 |
+
"Arthropoda 234\n",
|
| 851 |
+
"Name: count, dtype: int64"
|
| 852 |
+
]
|
| 853 |
+
},
|
| 854 |
+
"execution_count": 26,
|
| 855 |
+
"metadata": {},
|
| 856 |
+
"output_type": "execute_result"
|
| 857 |
+
}
|
| 858 |
+
],
|
| 859 |
+
"source": [
|
| 860 |
+
"parent_hybrid_cat.phylum.value_counts()"
|
| 861 |
+
]
|
| 862 |
+
},
|
| 863 |
+
{
|
| 864 |
+
"cell_type": "markdown",
|
| 865 |
+
"metadata": {},
|
| 866 |
+
"source": [
|
| 867 |
+
"It looks like we probably captured the proper subset now...Arthropoda has butterflies, some of which seem mis-labeled higher up."
|
| 868 |
+
]
|
| 869 |
+
},
|
| 870 |
+
{
|
| 871 |
+
"cell_type": "markdown",
|
| 872 |
+
"metadata": {},
|
| 873 |
+
"source": [
|
| 874 |
+
"Great, let's check the one extra phylum now."
|
| 875 |
+
]
|
| 876 |
+
},
|
| 877 |
+
{
|
| 878 |
+
"cell_type": "markdown",
|
| 879 |
+
"metadata": {},
|
| 880 |
+
"source": [
|
| 881 |
+
"These likely are accurate since butterflies are in the phylum `Arthropoda`."
|
| 882 |
+
]
|
| 883 |
+
},
|
| 884 |
+
{
|
| 885 |
+
"cell_type": "code",
|
| 886 |
+
"execution_count": 27,
|
| 887 |
+
"metadata": {},
|
| 888 |
+
"outputs": [
|
| 889 |
+
{
|
| 890 |
+
"data": {
|
| 891 |
+
"text/plain": [
|
| 892 |
+
"treeoflife_id 1648\n",
|
| 893 |
+
"eol_content_id 1648\n",
|
| 894 |
+
"eol_page_id 157\n",
|
| 895 |
+
"kingdom 1\n",
|
| 896 |
+
"phylum 1\n",
|
| 897 |
+
"class 1\n",
|
| 898 |
+
"order 3\n",
|
| 899 |
+
"family 4\n",
|
| 900 |
+
"genus 4\n",
|
| 901 |
+
"species 131\n",
|
| 902 |
+
"common 134\n",
|
| 903 |
+
"dtype: int64"
|
| 904 |
+
]
|
| 905 |
+
},
|
| 906 |
+
"execution_count": 27,
|
| 907 |
+
"metadata": {},
|
| 908 |
+
"output_type": "execute_result"
|
| 909 |
+
}
|
| 910 |
+
],
|
| 911 |
+
"source": [
|
| 912 |
+
"eol_hybrid_catalog.loc[eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\"].nunique()"
|
| 913 |
+
]
|
| 914 |
+
},
|
| 915 |
+
{
|
| 916 |
+
"cell_type": "code",
|
| 917 |
+
"execution_count": 28,
|
| 918 |
+
"metadata": {},
|
| 919 |
+
"outputs": [
|
| 920 |
+
{
|
| 921 |
+
"name": "stdout",
|
| 922 |
+
"output_type": "stream",
|
| 923 |
+
"text": [
|
| 924 |
+
"family\n",
|
| 925 |
+
"Hesperiidae 779\n",
|
| 926 |
+
"Sphecidae 567\n",
|
| 927 |
+
"Erebidae 280\n",
|
| 928 |
+
"Tingidae 22\n",
|
| 929 |
+
"Name: count, dtype: int64\n",
|
| 930 |
+
"\n",
|
| 931 |
+
"genus\n",
|
| 932 |
+
"Viola 779\n",
|
| 933 |
+
"Ammophila 567\n",
|
| 934 |
+
"Laelia 280\n",
|
| 935 |
+
"Ulmus 22\n",
|
| 936 |
+
"Name: count, dtype: int64\n"
|
| 937 |
+
]
|
| 938 |
+
}
|
| 939 |
+
],
|
| 940 |
+
"source": [
|
| 941 |
+
"print(eol_hybrid_catalog.loc[eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\", \"family\"].value_counts())\n",
|
| 942 |
+
"print()\n",
|
| 943 |
+
"print(eol_hybrid_catalog.loc[eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\", \"genus\"].value_counts())"
|
| 944 |
+
]
|
| 945 |
+
},
|
| 946 |
+
{
|
| 947 |
+
"cell_type": "code",
|
| 948 |
+
"execution_count": 29,
|
| 949 |
+
"metadata": {},
|
| 950 |
+
"outputs": [
|
| 951 |
+
{
|
| 952 |
+
"data": {
|
| 953 |
+
"text/html": [
|
| 954 |
+
"<div>\n",
|
| 955 |
+
"<style scoped>\n",
|
| 956 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 957 |
+
" vertical-align: middle;\n",
|
| 958 |
+
" }\n",
|
| 959 |
+
"\n",
|
| 960 |
+
" .dataframe tbody tr th {\n",
|
| 961 |
+
" vertical-align: top;\n",
|
| 962 |
+
" }\n",
|
| 963 |
+
"\n",
|
| 964 |
+
" .dataframe thead th {\n",
|
| 965 |
+
" text-align: right;\n",
|
| 966 |
+
" }\n",
|
| 967 |
+
"</style>\n",
|
| 968 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 969 |
+
" <thead>\n",
|
| 970 |
+
" <tr style=\"text-align: right;\">\n",
|
| 971 |
+
" <th></th>\n",
|
| 972 |
+
" <th>treeoflife_id</th>\n",
|
| 973 |
+
" <th>eol_content_id</th>\n",
|
| 974 |
+
" <th>eol_page_id</th>\n",
|
| 975 |
+
" <th>kingdom</th>\n",
|
| 976 |
+
" <th>phylum</th>\n",
|
| 977 |
+
" <th>class</th>\n",
|
| 978 |
+
" <th>order</th>\n",
|
| 979 |
+
" <th>family</th>\n",
|
| 980 |
+
" <th>genus</th>\n",
|
| 981 |
+
" <th>species</th>\n",
|
| 982 |
+
" <th>common</th>\n",
|
| 983 |
+
" </tr>\n",
|
| 984 |
+
" </thead>\n",
|
| 985 |
+
" <tbody>\n",
|
| 986 |
+
" <tr>\n",
|
| 987 |
+
" <th>2905374</th>\n",
|
| 988 |
+
" <td>b2382090-4793-434d-b588-b97df797ba13</td>\n",
|
| 989 |
+
" <td>8817503.0</td>\n",
|
| 990 |
+
" <td>49952851.0</td>\n",
|
| 991 |
+
" <td>Animalia</td>\n",
|
| 992 |
+
" <td>Arthropoda</td>\n",
|
| 993 |
+
" <td>Insecta</td>\n",
|
| 994 |
+
" <td>Lepidoptera</td>\n",
|
| 995 |
+
" <td>Hesperiidae</td>\n",
|
| 996 |
+
" <td>Viola</td>\n",
|
| 997 |
+
" <td>lobata</td>\n",
|
| 998 |
+
" <td>pine violet</td>\n",
|
| 999 |
+
" </tr>\n",
|
| 1000 |
+
" <tr>\n",
|
| 1001 |
+
" <th>7925784</th>\n",
|
| 1002 |
+
" <td>b317e17a-a5ff-4fcc-9cdc-161cc437028c</td>\n",
|
| 1003 |
+
" <td>14011714.0</td>\n",
|
| 1004 |
+
" <td>62636336.0</td>\n",
|
| 1005 |
+
" <td>Animalia</td>\n",
|
| 1006 |
+
" <td>Arthropoda</td>\n",
|
| 1007 |
+
" <td>Insecta</td>\n",
|
| 1008 |
+
" <td>Lepidoptera</td>\n",
|
| 1009 |
+
" <td>Hesperiidae</td>\n",
|
| 1010 |
+
" <td>Viola</td>\n",
|
| 1011 |
+
" <td>riviniana</td>\n",
|
| 1012 |
+
" <td>common dog-violet</td>\n",
|
| 1013 |
+
" </tr>\n",
|
| 1014 |
+
" <tr>\n",
|
| 1015 |
+
" <th>9434535</th>\n",
|
| 1016 |
+
" <td>0b970407-54d5-4ba6-9f72-c52c8e4d9c52</td>\n",
|
| 1017 |
+
" <td>8968367.0</td>\n",
|
| 1018 |
+
" <td>49957031.0</td>\n",
|
| 1019 |
+
" <td>Animalia</td>\n",
|
| 1020 |
+
" <td>Arthropoda</td>\n",
|
| 1021 |
+
" <td>Insecta</td>\n",
|
| 1022 |
+
" <td>Lepidoptera</td>\n",
|
| 1023 |
+
" <td>Hesperiidae</td>\n",
|
| 1024 |
+
" <td>Viola</td>\n",
|
| 1025 |
+
" <td>purpurea</td>\n",
|
| 1026 |
+
" <td>goosefoot violet</td>\n",
|
| 1027 |
+
" </tr>\n",
|
| 1028 |
+
" <tr>\n",
|
| 1029 |
+
" <th>5851991</th>\n",
|
| 1030 |
+
" <td>649c8ec6-2eef-480c-8b01-3de431cd2d97</td>\n",
|
| 1031 |
+
" <td>14011710.0</td>\n",
|
| 1032 |
+
" <td>62636336.0</td>\n",
|
| 1033 |
+
" <td>Animalia</td>\n",
|
| 1034 |
+
" <td>Arthropoda</td>\n",
|
| 1035 |
+
" <td>Insecta</td>\n",
|
| 1036 |
+
" <td>Lepidoptera</td>\n",
|
| 1037 |
+
" <td>Hesperiidae</td>\n",
|
| 1038 |
+
" <td>Viola</td>\n",
|
| 1039 |
+
" <td>riviniana</td>\n",
|
| 1040 |
+
" <td>common dog-violet</td>\n",
|
| 1041 |
+
" </tr>\n",
|
| 1042 |
+
" <tr>\n",
|
| 1043 |
+
" <th>2645634</th>\n",
|
| 1044 |
+
" <td>14bb7ec5-7fe0-4f36-9d5d-e8684695a8a6</td>\n",
|
| 1045 |
+
" <td>8804533.0</td>\n",
|
| 1046 |
+
" <td>49952482.0</td>\n",
|
| 1047 |
+
" <td>Animalia</td>\n",
|
| 1048 |
+
" <td>Arthropoda</td>\n",
|
| 1049 |
+
" <td>Insecta</td>\n",
|
| 1050 |
+
" <td>Lepidoptera</td>\n",
|
| 1051 |
+
" <td>Hesperiidae</td>\n",
|
| 1052 |
+
" <td>Viola</td>\n",
|
| 1053 |
+
" <td>blanda</td>\n",
|
| 1054 |
+
" <td>sweet white violet</td>\n",
|
| 1055 |
+
" </tr>\n",
|
| 1056 |
+
" <tr>\n",
|
| 1057 |
+
" <th>4147908</th>\n",
|
| 1058 |
+
" <td>abb52e06-7a4c-473e-a251-775192d985d2</td>\n",
|
| 1059 |
+
" <td>21181429.0</td>\n",
|
| 1060 |
+
" <td>186119.0</td>\n",
|
| 1061 |
+
" <td>Animalia</td>\n",
|
| 1062 |
+
" <td>Arthropoda</td>\n",
|
| 1063 |
+
" <td>Insecta</td>\n",
|
| 1064 |
+
" <td>Lepidoptera</td>\n",
|
| 1065 |
+
" <td>Hesperiidae</td>\n",
|
| 1066 |
+
" <td>Viola</td>\n",
|
| 1067 |
+
" <td>minor</td>\n",
|
| 1068 |
+
" <td>Viola minor</td>\n",
|
| 1069 |
+
" </tr>\n",
|
| 1070 |
+
" <tr>\n",
|
| 1071 |
+
" <th>2362509</th>\n",
|
| 1072 |
+
" <td>4544d1f9-8c85-4b27-83e5-09044b34e954</td>\n",
|
| 1073 |
+
" <td>8757030.0</td>\n",
|
| 1074 |
+
" <td>49951271.0</td>\n",
|
| 1075 |
+
" <td>Animalia</td>\n",
|
| 1076 |
+
" <td>Arthropoda</td>\n",
|
| 1077 |
+
" <td>Insecta</td>\n",
|
| 1078 |
+
" <td>Lepidoptera</td>\n",
|
| 1079 |
+
" <td>Hesperiidae</td>\n",
|
| 1080 |
+
" <td>Viola</td>\n",
|
| 1081 |
+
" <td>wittrockiana</td>\n",
|
| 1082 |
+
" <td>hybrid violet</td>\n",
|
| 1083 |
+
" </tr>\n",
|
| 1084 |
+
" </tbody>\n",
|
| 1085 |
+
"</table>\n",
|
| 1086 |
+
"</div>"
|
| 1087 |
+
],
|
| 1088 |
+
"text/plain": [
|
| 1089 |
+
" treeoflife_id eol_content_id eol_page_id \\\n",
|
| 1090 |
+
"2905374 b2382090-4793-434d-b588-b97df797ba13 8817503.0 49952851.0 \n",
|
| 1091 |
+
"7925784 b317e17a-a5ff-4fcc-9cdc-161cc437028c 14011714.0 62636336.0 \n",
|
| 1092 |
+
"9434535 0b970407-54d5-4ba6-9f72-c52c8e4d9c52 8968367.0 49957031.0 \n",
|
| 1093 |
+
"5851991 649c8ec6-2eef-480c-8b01-3de431cd2d97 14011710.0 62636336.0 \n",
|
| 1094 |
+
"2645634 14bb7ec5-7fe0-4f36-9d5d-e8684695a8a6 8804533.0 49952482.0 \n",
|
| 1095 |
+
"4147908 abb52e06-7a4c-473e-a251-775192d985d2 21181429.0 186119.0 \n",
|
| 1096 |
+
"2362509 4544d1f9-8c85-4b27-83e5-09044b34e954 8757030.0 49951271.0 \n",
|
| 1097 |
+
"\n",
|
| 1098 |
+
" kingdom phylum class order family genus \\\n",
|
| 1099 |
+
"2905374 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1100 |
+
"7925784 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1101 |
+
"9434535 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1102 |
+
"5851991 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1103 |
+
"2645634 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1104 |
+
"4147908 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1105 |
+
"2362509 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1106 |
+
"\n",
|
| 1107 |
+
" species common \n",
|
| 1108 |
+
"2905374 lobata pine violet \n",
|
| 1109 |
+
"7925784 riviniana common dog-violet \n",
|
| 1110 |
+
"9434535 purpurea goosefoot violet \n",
|
| 1111 |
+
"5851991 riviniana common dog-violet \n",
|
| 1112 |
+
"2645634 blanda sweet white violet \n",
|
| 1113 |
+
"4147908 minor Viola minor \n",
|
| 1114 |
+
"2362509 wittrockiana hybrid violet "
|
| 1115 |
+
]
|
| 1116 |
+
},
|
| 1117 |
+
"execution_count": 29,
|
| 1118 |
+
"metadata": {},
|
| 1119 |
+
"output_type": "execute_result"
|
| 1120 |
+
}
|
| 1121 |
+
],
|
| 1122 |
+
"source": [
|
| 1123 |
+
"eol_hybrid_catalog.loc[(eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\") & (eol_hybrid_catalog[\"genus\"] == \"Viola\")].sample(7)"
|
| 1124 |
+
]
|
| 1125 |
+
},
|
| 1126 |
+
{
|
| 1127 |
+
"cell_type": "code",
|
| 1128 |
+
"execution_count": 30,
|
| 1129 |
+
"metadata": {},
|
| 1130 |
+
"outputs": [
|
| 1131 |
+
{
|
| 1132 |
+
"data": {
|
| 1133 |
+
"text/plain": [
|
| 1134 |
+
"50"
|
| 1135 |
+
]
|
| 1136 |
+
},
|
| 1137 |
+
"execution_count": 30,
|
| 1138 |
+
"metadata": {},
|
| 1139 |
+
"output_type": "execute_result"
|
| 1140 |
+
}
|
| 1141 |
+
],
|
| 1142 |
+
"source": [
|
| 1143 |
+
"eol_hybrid_catalog.loc[(eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\") & (eol_hybrid_catalog[\"genus\"] == \"Viola\"), \"species\"].nunique()"
|
| 1144 |
+
]
|
| 1145 |
+
},
|
| 1146 |
+
{
|
| 1147 |
+
"cell_type": "markdown",
|
| 1148 |
+
"metadata": {},
|
| 1149 |
+
"source": [
|
| 1150 |
+
"look at actual images"
|
| 1151 |
+
]
|
| 1152 |
+
},
|
| 1153 |
+
{
|
| 1154 |
+
"cell_type": "code",
|
| 1155 |
+
"execution_count": 31,
|
| 1156 |
+
"metadata": {},
|
| 1157 |
+
"outputs": [],
|
| 1158 |
+
"source": [
|
| 1159 |
+
"eol_hybrid_catalog = eol_hybrid_catalog.astype({\"eol_content_id\": \"int64\", \"eol_page_id\": \"int64\"})"
|
| 1160 |
+
]
|
| 1161 |
+
},
|
| 1162 |
+
{
|
| 1163 |
+
"cell_type": "code",
|
| 1164 |
+
"execution_count": 32,
|
| 1165 |
+
"metadata": {},
|
| 1166 |
+
"outputs": [],
|
| 1167 |
+
"source": [
|
| 1168 |
+
"eol_hybrid_catalog[\"filename\"] = eol_hybrid_catalog[\"eol_content_id\"].astype(str) + \"_\" + eol_hybrid_catalog[\"eol_page_id\"].astype(str) + \"_eol-full-size-copy.jpg\""
|
| 1169 |
+
]
|
| 1170 |
+
},
|
| 1171 |
+
{
|
| 1172 |
+
"cell_type": "code",
|
| 1173 |
+
"execution_count": 34,
|
| 1174 |
+
"metadata": {},
|
| 1175 |
+
"outputs": [
|
| 1176 |
+
{
|
| 1177 |
+
"data": {
|
| 1178 |
+
"text/html": [
|
| 1179 |
+
"<div>\n",
|
| 1180 |
+
"<style scoped>\n",
|
| 1181 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1182 |
+
" vertical-align: middle;\n",
|
| 1183 |
+
" }\n",
|
| 1184 |
+
"\n",
|
| 1185 |
+
" .dataframe tbody tr th {\n",
|
| 1186 |
+
" vertical-align: top;\n",
|
| 1187 |
+
" }\n",
|
| 1188 |
+
"\n",
|
| 1189 |
+
" .dataframe thead th {\n",
|
| 1190 |
+
" text-align: right;\n",
|
| 1191 |
+
" }\n",
|
| 1192 |
+
"</style>\n",
|
| 1193 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1194 |
+
" <thead>\n",
|
| 1195 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1196 |
+
" <th></th>\n",
|
| 1197 |
+
" <th>treeoflife_id</th>\n",
|
| 1198 |
+
" <th>eol_content_id</th>\n",
|
| 1199 |
+
" <th>eol_page_id</th>\n",
|
| 1200 |
+
" <th>kingdom</th>\n",
|
| 1201 |
+
" <th>phylum</th>\n",
|
| 1202 |
+
" <th>class</th>\n",
|
| 1203 |
+
" <th>order</th>\n",
|
| 1204 |
+
" <th>family</th>\n",
|
| 1205 |
+
" <th>genus</th>\n",
|
| 1206 |
+
" <th>species</th>\n",
|
| 1207 |
+
" <th>common</th>\n",
|
| 1208 |
+
" <th>filename</th>\n",
|
| 1209 |
+
" </tr>\n",
|
| 1210 |
+
" </thead>\n",
|
| 1211 |
+
" <tbody>\n",
|
| 1212 |
+
" <tr>\n",
|
| 1213 |
+
" <th>9945290</th>\n",
|
| 1214 |
+
" <td>1ae66dcb-84c5-43ff-ab66-0faee923635a</td>\n",
|
| 1215 |
+
" <td>29906970</td>\n",
|
| 1216 |
+
" <td>65415246</td>\n",
|
| 1217 |
+
" <td>Animalia</td>\n",
|
| 1218 |
+
" <td>Arthropoda</td>\n",
|
| 1219 |
+
" <td>Insecta</td>\n",
|
| 1220 |
+
" <td>Lepidoptera</td>\n",
|
| 1221 |
+
" <td>Hesperiidae</td>\n",
|
| 1222 |
+
" <td>Viola</td>\n",
|
| 1223 |
+
" <td>×williamsii</td>\n",
|
| 1224 |
+
" <td>Viola ×williamsii</td>\n",
|
| 1225 |
+
" <td>29906970_65415246_eol-full-size-copy.jpg</td>\n",
|
| 1226 |
+
" </tr>\n",
|
| 1227 |
+
" <tr>\n",
|
| 1228 |
+
" <th>6788354</th>\n",
|
| 1229 |
+
" <td>875156a5-5811-4069-ab8d-ee51c0ae0454</td>\n",
|
| 1230 |
+
" <td>8791997</td>\n",
|
| 1231 |
+
" <td>49952170</td>\n",
|
| 1232 |
+
" <td>Animalia</td>\n",
|
| 1233 |
+
" <td>Arthropoda</td>\n",
|
| 1234 |
+
" <td>Insecta</td>\n",
|
| 1235 |
+
" <td>Lepidoptera</td>\n",
|
| 1236 |
+
" <td>Hesperiidae</td>\n",
|
| 1237 |
+
" <td>Viola</td>\n",
|
| 1238 |
+
" <td>chamissoniana</td>\n",
|
| 1239 |
+
" <td>olopu</td>\n",
|
| 1240 |
+
" <td>8791997_49952170_eol-full-size-copy.jpg</td>\n",
|
| 1241 |
+
" </tr>\n",
|
| 1242 |
+
" <tr>\n",
|
| 1243 |
+
" <th>4280132</th>\n",
|
| 1244 |
+
" <td>3f4286e5-b5d7-4533-9130-ef5d15a1c048</td>\n",
|
| 1245 |
+
" <td>8922943</td>\n",
|
| 1246 |
+
" <td>49955771</td>\n",
|
| 1247 |
+
" <td>Animalia</td>\n",
|
| 1248 |
+
" <td>Arthropoda</td>\n",
|
| 1249 |
+
" <td>Insecta</td>\n",
|
| 1250 |
+
" <td>Lepidoptera</td>\n",
|
| 1251 |
+
" <td>Hesperiidae</td>\n",
|
| 1252 |
+
" <td>Viola</td>\n",
|
| 1253 |
+
" <td>purpurea</td>\n",
|
| 1254 |
+
" <td>goosefoot violet</td>\n",
|
| 1255 |
+
" <td>8922943_49955771_eol-full-size-copy.jpg</td>\n",
|
| 1256 |
+
" </tr>\n",
|
| 1257 |
+
" <tr>\n",
|
| 1258 |
+
" <th>1338393</th>\n",
|
| 1259 |
+
" <td>489863d2-3c59-4442-96e6-900b45f5ac24</td>\n",
|
| 1260 |
+
" <td>8756992</td>\n",
|
| 1261 |
+
" <td>49951271</td>\n",
|
| 1262 |
+
" <td>Animalia</td>\n",
|
| 1263 |
+
" <td>Arthropoda</td>\n",
|
| 1264 |
+
" <td>Insecta</td>\n",
|
| 1265 |
+
" <td>Lepidoptera</td>\n",
|
| 1266 |
+
" <td>Hesperiidae</td>\n",
|
| 1267 |
+
" <td>Viola</td>\n",
|
| 1268 |
+
" <td>wittrockiana</td>\n",
|
| 1269 |
+
" <td>hybrid violet</td>\n",
|
| 1270 |
+
" <td>8756992_49951271_eol-full-size-copy.jpg</td>\n",
|
| 1271 |
+
" </tr>\n",
|
| 1272 |
+
" <tr>\n",
|
| 1273 |
+
" <th>2362509</th>\n",
|
| 1274 |
+
" <td>4544d1f9-8c85-4b27-83e5-09044b34e954</td>\n",
|
| 1275 |
+
" <td>8757030</td>\n",
|
| 1276 |
+
" <td>49951271</td>\n",
|
| 1277 |
+
" <td>Animalia</td>\n",
|
| 1278 |
+
" <td>Arthropoda</td>\n",
|
| 1279 |
+
" <td>Insecta</td>\n",
|
| 1280 |
+
" <td>Lepidoptera</td>\n",
|
| 1281 |
+
" <td>Hesperiidae</td>\n",
|
| 1282 |
+
" <td>Viola</td>\n",
|
| 1283 |
+
" <td>wittrockiana</td>\n",
|
| 1284 |
+
" <td>hybrid violet</td>\n",
|
| 1285 |
+
" <td>8757030_49951271_eol-full-size-copy.jpg</td>\n",
|
| 1286 |
+
" </tr>\n",
|
| 1287 |
+
" <tr>\n",
|
| 1288 |
+
" <th>5200572</th>\n",
|
| 1289 |
+
" <td>e8190144-9033-4998-92be-ae278e4baedb</td>\n",
|
| 1290 |
+
" <td>29907020</td>\n",
|
| 1291 |
+
" <td>65415246</td>\n",
|
| 1292 |
+
" <td>Animalia</td>\n",
|
| 1293 |
+
" <td>Arthropoda</td>\n",
|
| 1294 |
+
" <td>Insecta</td>\n",
|
| 1295 |
+
" <td>Lepidoptera</td>\n",
|
| 1296 |
+
" <td>Hesperiidae</td>\n",
|
| 1297 |
+
" <td>Viola</td>\n",
|
| 1298 |
+
" <td>×williamsii</td>\n",
|
| 1299 |
+
" <td>Viola ×williamsii</td>\n",
|
| 1300 |
+
" <td>29907020_65415246_eol-full-size-copy.jpg</td>\n",
|
| 1301 |
+
" </tr>\n",
|
| 1302 |
+
" <tr>\n",
|
| 1303 |
+
" <th>3721955</th>\n",
|
| 1304 |
+
" <td>7bf000bb-8f79-44ec-b7e2-c21922607a41</td>\n",
|
| 1305 |
+
" <td>22255430</td>\n",
|
| 1306 |
+
" <td>64639830</td>\n",
|
| 1307 |
+
" <td>Animalia</td>\n",
|
| 1308 |
+
" <td>Arthropoda</td>\n",
|
| 1309 |
+
" <td>Insecta</td>\n",
|
| 1310 |
+
" <td>Lepidoptera</td>\n",
|
| 1311 |
+
" <td>Hesperiidae</td>\n",
|
| 1312 |
+
" <td>Viola</td>\n",
|
| 1313 |
+
" <td>eriocarpon</td>\n",
|
| 1314 |
+
" <td>Viola eriocarpon</td>\n",
|
| 1315 |
+
" <td>22255430_64639830_eol-full-size-copy.jpg</td>\n",
|
| 1316 |
+
" </tr>\n",
|
| 1317 |
+
" </tbody>\n",
|
| 1318 |
+
"</table>\n",
|
| 1319 |
+
"</div>"
|
| 1320 |
+
],
|
| 1321 |
+
"text/plain": [
|
| 1322 |
+
" treeoflife_id eol_content_id eol_page_id \\\n",
|
| 1323 |
+
"9945290 1ae66dcb-84c5-43ff-ab66-0faee923635a 29906970 65415246 \n",
|
| 1324 |
+
"6788354 875156a5-5811-4069-ab8d-ee51c0ae0454 8791997 49952170 \n",
|
| 1325 |
+
"4280132 3f4286e5-b5d7-4533-9130-ef5d15a1c048 8922943 49955771 \n",
|
| 1326 |
+
"1338393 489863d2-3c59-4442-96e6-900b45f5ac24 8756992 49951271 \n",
|
| 1327 |
+
"2362509 4544d1f9-8c85-4b27-83e5-09044b34e954 8757030 49951271 \n",
|
| 1328 |
+
"5200572 e8190144-9033-4998-92be-ae278e4baedb 29907020 65415246 \n",
|
| 1329 |
+
"3721955 7bf000bb-8f79-44ec-b7e2-c21922607a41 22255430 64639830 \n",
|
| 1330 |
+
"\n",
|
| 1331 |
+
" kingdom phylum class order family genus \\\n",
|
| 1332 |
+
"9945290 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1333 |
+
"6788354 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1334 |
+
"4280132 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1335 |
+
"1338393 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1336 |
+
"2362509 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1337 |
+
"5200572 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1338 |
+
"3721955 Animalia Arthropoda Insecta Lepidoptera Hesperiidae Viola \n",
|
| 1339 |
+
"\n",
|
| 1340 |
+
" species common \\\n",
|
| 1341 |
+
"9945290 ×williamsii Viola ×williamsii \n",
|
| 1342 |
+
"6788354 chamissoniana olopu \n",
|
| 1343 |
+
"4280132 purpurea goosefoot violet \n",
|
| 1344 |
+
"1338393 wittrockiana hybrid violet \n",
|
| 1345 |
+
"2362509 wittrockiana hybrid violet \n",
|
| 1346 |
+
"5200572 ×williamsii Viola ×williamsii \n",
|
| 1347 |
+
"3721955 eriocarpon Viola eriocarpon \n",
|
| 1348 |
+
"\n",
|
| 1349 |
+
" filename \n",
|
| 1350 |
+
"9945290 29906970_65415246_eol-full-size-copy.jpg \n",
|
| 1351 |
+
"6788354 8791997_49952170_eol-full-size-copy.jpg \n",
|
| 1352 |
+
"4280132 8922943_49955771_eol-full-size-copy.jpg \n",
|
| 1353 |
+
"1338393 8756992_49951271_eol-full-size-copy.jpg \n",
|
| 1354 |
+
"2362509 8757030_49951271_eol-full-size-copy.jpg \n",
|
| 1355 |
+
"5200572 29907020_65415246_eol-full-size-copy.jpg \n",
|
| 1356 |
+
"3721955 22255430_64639830_eol-full-size-copy.jpg "
|
| 1357 |
+
]
|
| 1358 |
+
},
|
| 1359 |
+
"execution_count": 34,
|
| 1360 |
+
"metadata": {},
|
| 1361 |
+
"output_type": "execute_result"
|
| 1362 |
+
}
|
| 1363 |
+
],
|
| 1364 |
+
"source": [
|
| 1365 |
+
"eol_hybrid_catalog.loc[(eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\") & (eol_hybrid_catalog[\"genus\"] == \"Viola\")].sample(7)"
|
| 1366 |
+
]
|
| 1367 |
+
},
|
| 1368 |
+
{
|
| 1369 |
+
"cell_type": "markdown",
|
| 1370 |
+
"metadata": {},
|
| 1371 |
+
"source": [
|
| 1372 |
+
"Save CSV of `eol_hybrid_catalog` as snapshot of these issues. A collection of sample images gathered from here will also be included."
|
| 1373 |
+
]
|
| 1374 |
+
},
|
| 1375 |
+
{
|
| 1376 |
+
"cell_type": "code",
|
| 1377 |
+
"execution_count": 37,
|
| 1378 |
+
"metadata": {},
|
| 1379 |
+
"outputs": [],
|
| 1380 |
+
"source": [
|
| 1381 |
+
"eol_hybrid_catalog.to_csv(DATA_PATH + \"taxa_files/ToL_hybrids_Arthropoda.csv\", index = False)"
|
| 1382 |
+
]
|
| 1383 |
+
},
|
| 1384 |
+
{
|
| 1385 |
+
"cell_type": "code",
|
| 1386 |
+
"execution_count": null,
|
| 1387 |
+
"metadata": {},
|
| 1388 |
+
"outputs": [],
|
| 1389 |
+
"source": []
|
| 1390 |
+
},
|
| 1391 |
+
{
|
| 1392 |
+
"cell_type": "markdown",
|
| 1393 |
+
"metadata": {},
|
| 1394 |
+
"source": [
|
| 1395 |
+
"These seem to have a mis-match at the genus-family connection. These genera seem to be plants (other than Ammophila, which is wasps)."
|
| 1396 |
+
]
|
| 1397 |
+
},
|
| 1398 |
+
{
|
| 1399 |
+
"cell_type": "code",
|
| 1400 |
+
"execution_count": 40,
|
| 1401 |
+
"metadata": {},
|
| 1402 |
+
"outputs": [],
|
| 1403 |
+
"source": [
|
| 1404 |
+
"arthropoda = [species for species in list(eol_hybrid_catalog.loc[eol_hybrid_catalog[\"phylum\"] == \"Arthropoda\", \"species\"].unique())]"
|
| 1405 |
+
]
|
| 1406 |
+
},
|
| 1407 |
+
{
|
| 1408 |
+
"cell_type": "code",
|
| 1409 |
+
"execution_count": 41,
|
| 1410 |
+
"metadata": {},
|
| 1411 |
+
"outputs": [
|
| 1412 |
+
{
|
| 1413 |
+
"name": "stdout",
|
| 1414 |
+
"output_type": "stream",
|
| 1415 |
+
"text": [
|
| 1416 |
+
"We have 13 parent species for 24 hybrids.\n"
|
| 1417 |
+
]
|
| 1418 |
+
}
|
| 1419 |
+
],
|
| 1420 |
+
"source": [
|
| 1421 |
+
"arthropoda_hybrids = []\n",
|
| 1422 |
+
"arthropoda_hybrid_parents = []\n",
|
| 1423 |
+
"\n",
|
| 1424 |
+
"for species in arthropoda:\n",
|
| 1425 |
+
" for hybrid in hybrid_list:\n",
|
| 1426 |
+
" if f\"{species} \" in hybrid or f\" {species}\" in hybrid:\n",
|
| 1427 |
+
" arthropoda_hybrids.append(hybrid)\n",
|
| 1428 |
+
" arthropoda_hybrid_parents.append(species)\n",
|
| 1429 |
+
"\n",
|
| 1430 |
+
"print(f\"We have {len(set(arthropoda_hybrid_parents))} parent species for {len(set(arthropoda_hybrids))} hybrids.\")"
|
| 1431 |
+
]
|
| 1432 |
+
},
|
| 1433 |
+
{
|
| 1434 |
+
"cell_type": "code",
|
| 1435 |
+
"execution_count": 42,
|
| 1436 |
+
"metadata": {},
|
| 1437 |
+
"outputs": [
|
| 1438 |
+
{
|
| 1439 |
+
"data": {
|
| 1440 |
+
"text/plain": [
|
| 1441 |
+
"{'alba',\n",
|
| 1442 |
+
" 'anceps',\n",
|
| 1443 |
+
" 'canadensis',\n",
|
| 1444 |
+
" 'canina',\n",
|
| 1445 |
+
" 'gigantea',\n",
|
| 1446 |
+
" 'glabra',\n",
|
| 1447 |
+
" 'lobata',\n",
|
| 1448 |
+
" 'nigra',\n",
|
| 1449 |
+
" 'nigricans',\n",
|
| 1450 |
+
" 'pubescens',\n",
|
| 1451 |
+
" 'purpurata',\n",
|
| 1452 |
+
" 'purpurea',\n",
|
| 1453 |
+
" 'sylvestris'}"
|
| 1454 |
+
]
|
| 1455 |
+
},
|
| 1456 |
+
"execution_count": 42,
|
| 1457 |
+
"metadata": {},
|
| 1458 |
+
"output_type": "execute_result"
|
| 1459 |
+
}
|
| 1460 |
+
],
|
| 1461 |
+
"source": [
|
| 1462 |
+
"set(arthropoda_hybrid_parents)"
|
| 1463 |
+
]
|
| 1464 |
+
},
|
| 1465 |
+
{
|
| 1466 |
+
"cell_type": "code",
|
| 1467 |
+
"execution_count": 43,
|
| 1468 |
+
"metadata": {},
|
| 1469 |
+
"outputs": [
|
| 1470 |
+
{
|
| 1471 |
+
"data": {
|
| 1472 |
+
"text/plain": [
|
| 1473 |
+
"{'alba x alba',\n",
|
| 1474 |
+
" 'alba x dioica',\n",
|
| 1475 |
+
" 'alba x pubescens',\n",
|
| 1476 |
+
" 'anceps x articulatus',\n",
|
| 1477 |
+
" 'aurita x nigricans',\n",
|
| 1478 |
+
" 'austriaca x sylvestris',\n",
|
| 1479 |
+
" 'canina x persicifolia =',\n",
|
| 1480 |
+
" 'colmarie x rhynchostylis gigantea red',\n",
|
| 1481 |
+
" 'euxina x alba =',\n",
|
| 1482 |
+
" 'ferrugineus x nigricans',\n",
|
| 1483 |
+
" 'formosa x pubescens',\n",
|
| 1484 |
+
" 'gigantea x vanda tessellata',\n",
|
| 1485 |
+
" 'glabra x nitens',\n",
|
| 1486 |
+
" 'leucopsis x canadensis',\n",
|
| 1487 |
+
" 'lobata x quercus berberidifolia',\n",
|
| 1488 |
+
" 'nana x pubescens',\n",
|
| 1489 |
+
" 'nigra x trinervis',\n",
|
| 1490 |
+
" 'nigricans x phylicifolia',\n",
|
| 1491 |
+
" 'pendula x pubescens =',\n",
|
| 1492 |
+
" 'purpurata suavis sissi x purpurata',\n",
|
| 1493 |
+
" 'purpurea x simia =',\n",
|
| 1494 |
+
" 'purpurea x viminalis',\n",
|
| 1495 |
+
" 'sylvestris x amphibia =',\n",
|
| 1496 |
+
" 'tenebrosa x purpurata alba'}"
|
| 1497 |
+
]
|
| 1498 |
+
},
|
| 1499 |
+
"execution_count": 43,
|
| 1500 |
+
"metadata": {},
|
| 1501 |
+
"output_type": "execute_result"
|
| 1502 |
+
}
|
| 1503 |
+
],
|
| 1504 |
+
"source": [
|
| 1505 |
+
"set(arthropoda_hybrids)"
|
| 1506 |
+
]
|
| 1507 |
+
},
|
| 1508 |
+
{
|
| 1509 |
+
"cell_type": "code",
|
| 1510 |
+
"execution_count": 44,
|
| 1511 |
+
"metadata": {},
|
| 1512 |
+
"outputs": [
|
| 1513 |
+
{
|
| 1514 |
+
"data": {
|
| 1515 |
+
"text/plain": [
|
| 1516 |
+
"False"
|
| 1517 |
+
]
|
| 1518 |
+
},
|
| 1519 |
+
"execution_count": 44,
|
| 1520 |
+
"metadata": {},
|
| 1521 |
+
"output_type": "execute_result"
|
| 1522 |
+
}
|
| 1523 |
+
],
|
| 1524 |
+
"source": [
|
| 1525 |
+
"\"euxina\" in set(arthropoda)"
|
| 1526 |
+
]
|
| 1527 |
+
},
|
| 1528 |
+
{
|
| 1529 |
+
"cell_type": "markdown",
|
| 1530 |
+
"metadata": {},
|
| 1531 |
+
"source": [
|
| 1532 |
+
"Both Salix and Dactylorhiza have species named \"euxina\". These are [plant genera](https://www.google.com/search?sca_esv=599157406&rlz=1C5CHFA_en___US1054&q=Salix+euxina&si=AKbGX_rO4P19IF_yO85wYpkEaz-W_oZWd5JUOOVnUVftf2aeob4EJjgqVllzSPxogeqSJCC4Zl8aXZbE51z70gOwz9lGuA0G1-yf7zcOgQX3XaBgMVlhgthMWR2cawrX1KYe34gkcEi4rg9HRHMQbxrrKmzPRVIvd0aODauTmZAgZBvGSlxrFCuIDT43Pt1slf-KM5Ea9k0U4xty1e_U_flApg9yiVpHTU-vu-M1TsHSj1gae0rq-B6iatHBbob7iyGAEZaUMTN_xh3ubpaTXcZ3suZvlRw_X-tP8HMalBz6NTDqG2WbmeRnzg8IpcCSe97jgSAbEAoE&sa=X&sqi=2&ved=2ahUKEwjT6tar5eSDAxW-lIkEHbIAC1sQxA16BAhKEAU&biw=1647&bih=909&dpr=1) that have hybrids in our sample set."
|
| 1533 |
+
]
|
| 1534 |
+
},
|
| 1535 |
+
{
|
| 1536 |
+
"cell_type": "markdown",
|
| 1537 |
+
"metadata": {},
|
| 1538 |
+
"source": [
|
| 1539 |
+
"It's odd to see an `alba x alba`, wouldn't that just be `alba`?\n",
|
| 1540 |
+
"\n",
|
| 1541 |
+
"see below."
|
| 1542 |
+
]
|
| 1543 |
+
},
|
| 1544 |
+
{
|
| 1545 |
+
"cell_type": "code",
|
| 1546 |
+
"execution_count": 66,
|
| 1547 |
+
"metadata": {},
|
| 1548 |
+
"outputs": [
|
| 1549 |
+
{
|
| 1550 |
+
"data": {
|
| 1551 |
+
"text/html": [
|
| 1552 |
+
"<div>\n",
|
| 1553 |
+
"<style scoped>\n",
|
| 1554 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1555 |
+
" vertical-align: middle;\n",
|
| 1556 |
+
" }\n",
|
| 1557 |
+
"\n",
|
| 1558 |
+
" .dataframe tbody tr th {\n",
|
| 1559 |
+
" vertical-align: top;\n",
|
| 1560 |
+
" }\n",
|
| 1561 |
+
"\n",
|
| 1562 |
+
" .dataframe thead th {\n",
|
| 1563 |
+
" text-align: right;\n",
|
| 1564 |
+
" }\n",
|
| 1565 |
+
"</style>\n",
|
| 1566 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1567 |
+
" <thead>\n",
|
| 1568 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1569 |
+
" <th></th>\n",
|
| 1570 |
+
" <th>treeoflife_id</th>\n",
|
| 1571 |
+
" <th>eol_content_id</th>\n",
|
| 1572 |
+
" <th>eol_page_id</th>\n",
|
| 1573 |
+
" <th>kingdom</th>\n",
|
| 1574 |
+
" <th>phylum</th>\n",
|
| 1575 |
+
" <th>class</th>\n",
|
| 1576 |
+
" <th>order</th>\n",
|
| 1577 |
+
" <th>family</th>\n",
|
| 1578 |
+
" <th>genus</th>\n",
|
| 1579 |
+
" <th>species</th>\n",
|
| 1580 |
+
" <th>common</th>\n",
|
| 1581 |
+
" </tr>\n",
|
| 1582 |
+
" </thead>\n",
|
| 1583 |
+
" <tbody>\n",
|
| 1584 |
+
" <tr>\n",
|
| 1585 |
+
" <th>5518363</th>\n",
|
| 1586 |
+
" <td>94c1b92c-3d2c-4253-9cba-d3c2d361082b</td>\n",
|
| 1587 |
+
" <td>28749458.0</td>\n",
|
| 1588 |
+
" <td>65060415.0</td>\n",
|
| 1589 |
+
" <td>NaN</td>\n",
|
| 1590 |
+
" <td>NaN</td>\n",
|
| 1591 |
+
" <td>NaN</td>\n",
|
| 1592 |
+
" <td>NaN</td>\n",
|
| 1593 |
+
" <td>NaN</td>\n",
|
| 1594 |
+
" <td>S.</td>\n",
|
| 1595 |
+
" <td>alba x alba</td>\n",
|
| 1596 |
+
" <td>S. alba x alba</td>\n",
|
| 1597 |
+
" </tr>\n",
|
| 1598 |
+
" </tbody>\n",
|
| 1599 |
+
"</table>\n",
|
| 1600 |
+
"</div>"
|
| 1601 |
+
],
|
| 1602 |
+
"text/plain": [
|
| 1603 |
+
" treeoflife_id eol_content_id eol_page_id \\\n",
|
| 1604 |
+
"5518363 94c1b92c-3d2c-4253-9cba-d3c2d361082b 28749458.0 65060415.0 \n",
|
| 1605 |
+
"\n",
|
| 1606 |
+
" kingdom phylum class order family genus species common \n",
|
| 1607 |
+
"5518363 NaN NaN NaN NaN NaN S. alba x alba S. alba x alba "
|
| 1608 |
+
]
|
| 1609 |
+
},
|
| 1610 |
+
"execution_count": 66,
|
| 1611 |
+
"metadata": {},
|
| 1612 |
+
"output_type": "execute_result"
|
| 1613 |
+
}
|
| 1614 |
+
],
|
| 1615 |
+
"source": [
|
| 1616 |
+
"eol_hybrid_catalog.loc[eol_hybrid_catalog[\"species\"] == \"alba x alba\"]"
|
| 1617 |
+
]
|
| 1618 |
+
},
|
| 1619 |
+
{
|
| 1620 |
+
"cell_type": "markdown",
|
| 1621 |
+
"metadata": {},
|
| 1622 |
+
"source": [
|
| 1623 |
+
"Looking at the actual [image](https://eol.org/pages/65060415/media) this is a variety, not a hybrid (and definitely not `alba x alba`).\n",
|
| 1624 |
+
"\n",
|
| 1625 |
+
"It seems there is a lot of overlap in species naming across the plant genera, so we need to be more careful in distinguishing parent species. "
|
| 1626 |
+
]
|
| 1627 |
+
},
|
| 1628 |
+
{
|
| 1629 |
+
"cell_type": "markdown",
|
| 1630 |
+
"metadata": {},
|
| 1631 |
+
"source": [
|
| 1632 |
+
"## Check Genus and Species against Hybrid Genus Species to Subset\n",
|
| 1633 |
+
"\n",
|
| 1634 |
+
"Due to common reuse of species names across genera for plants (the majority of our hybrids), we need to check both the genus and the species name against the genus and species of our hybrids when making the parent list."
|
| 1635 |
+
]
|
| 1636 |
+
},
|
| 1637 |
+
{
|
| 1638 |
+
"cell_type": "code",
|
| 1639 |
+
"execution_count": 67,
|
| 1640 |
+
"metadata": {},
|
| 1641 |
+
"outputs": [],
|
| 1642 |
+
"source": [
|
| 1643 |
+
"eol_hybrid_catalog[\"sci_name\"] = eol_hybrid_catalog[\"genus\"] + \" \" + eol_hybrid_catalog[\"species\"]"
|
| 1644 |
+
]
|
| 1645 |
+
},
|
| 1646 |
+
{
|
| 1647 |
+
"cell_type": "code",
|
| 1648 |
+
"execution_count": null,
|
| 1649 |
+
"metadata": {},
|
| 1650 |
+
"outputs": [],
|
| 1651 |
+
"source": []
|
| 1652 |
+
}
|
| 1653 |
+
],
|
| 1654 |
+
"metadata": {
|
| 1655 |
+
"kernelspec": {
|
| 1656 |
+
"display_name": "std",
|
| 1657 |
+
"language": "python",
|
| 1658 |
+
"name": "python3"
|
| 1659 |
+
},
|
| 1660 |
+
"language_info": {
|
| 1661 |
+
"codemirror_mode": {
|
| 1662 |
+
"name": "ipython",
|
| 1663 |
+
"version": 3
|
| 1664 |
+
},
|
| 1665 |
+
"file_extension": ".py",
|
| 1666 |
+
"mimetype": "text/x-python",
|
| 1667 |
+
"name": "python",
|
| 1668 |
+
"nbconvert_exporter": "python",
|
| 1669 |
+
"pygments_lexer": "ipython3",
|
| 1670 |
+
"version": "3.11.3"
|
| 1671 |
+
}
|
| 1672 |
+
},
|
| 1673 |
+
"nbformat": 4,
|
| 1674 |
+
"nbformat_minor": 2
|
| 1675 |
+
}
|