Datasets:
Some more data cleaning and stats, deduped images and reduced down to species designation
Browse files- lilabc_CT.ipynb +730 -1
lilabc_CT.ipynb
CHANGED
|
@@ -1211,7 +1211,7 @@
|
|
| 1211 |
"cell_type": "markdown",
|
| 1212 |
"metadata": {},
|
| 1213 |
"source": [
|
| 1214 |
-
"These match the duplicated `image_id`s as well. Perhaps this is more than one animal in the frame?"
|
| 1215 |
]
|
| 1216 |
},
|
| 1217 |
{
|
|
@@ -2071,6 +2071,735 @@
|
|
| 2071 |
"We have 1,046,985 distinct sequence IDs for the 6,901,819 unique image IDs, suggesting an average of 6 images per sequence?"
|
| 2072 |
]
|
| 2073 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2074 |
{
|
| 2075 |
"cell_type": "code",
|
| 2076 |
"execution_count": null,
|
|
|
|
| 1211 |
"cell_type": "markdown",
|
| 1212 |
"metadata": {},
|
| 1213 |
"source": [
|
| 1214 |
+
"These match the duplicated `image_id`s as well. Perhaps this is more than one animal in the frame? In which case it is important to mark all the potential duplicates as duplicates, not just the instances after the image's first occurence."
|
| 1215 |
]
|
| 1216 |
},
|
| 1217 |
{
|
|
|
|
| 2071 |
"We have 1,046,985 distinct sequence IDs for the 6,901,819 unique image IDs, suggesting an average of 6 images per sequence?"
|
| 2072 |
]
|
| 2073 |
},
|
| 2074 |
+
{
|
| 2075 |
+
"cell_type": "code",
|
| 2076 |
+
"execution_count": 32,
|
| 2077 |
+
"metadata": {},
|
| 2078 |
+
"outputs": [
|
| 2079 |
+
{
|
| 2080 |
+
"data": {
|
| 2081 |
+
"text/plain": [
|
| 2082 |
+
"array([['Caltech Camera Traps',\n",
|
| 2083 |
+
" 'https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/5a0b016f-23d2-11e8-a6a3-ec086b02610b.jpg',\n",
|
| 2084 |
+
" 'Caltech Camera Traps : 5a0b016f-23d2-11e8-a6a3-ec086b02610b',\n",
|
| 2085 |
+
" 'Caltech Camera Traps : 6f27ed66-5567-11e8-9e92-dca9047ef277',\n",
|
| 2086 |
+
" 'Caltech Camera Traps : 26', 1, 'deer', 'odocoileus', 'deer',\n",
|
| 2087 |
+
" '11-04-2013 18:37:07', 'image', 'animalia', 'chordata',\n",
|
| 2088 |
+
" 'vertebrata', nan, 'mammalia', 'theria', 'placentalia',\n",
|
| 2089 |
+
" 'laurasiatheria', 'artiodactyla', 'ruminantia', nan, nan,\n",
|
| 2090 |
+
" 'cervidae', 'capreolinae', 'odocoileini', 'odocoileus', nan, nan,\n",
|
| 2091 |
+
" nan, False]], dtype=object)"
|
| 2092 |
+
]
|
| 2093 |
+
},
|
| 2094 |
+
"execution_count": 32,
|
| 2095 |
+
"metadata": {},
|
| 2096 |
+
"output_type": "execute_result"
|
| 2097 |
+
}
|
| 2098 |
+
],
|
| 2099 |
+
"source": [
|
| 2100 |
+
"df_genusSpecies.head(1).values"
|
| 2101 |
+
]
|
| 2102 |
+
},
|
| 2103 |
+
{
|
| 2104 |
+
"cell_type": "markdown",
|
| 2105 |
+
"metadata": {},
|
| 2106 |
+
"source": [
|
| 2107 |
+
"The end of the URL `cct_images/...jpg` matches the `file` indicator in the model results from LILA BC for MegaDetector. We will use agreement about the animal's precense from both [v5a and v5b models](https://lila.science/megadetector-results-for-camera-trap-datasets/) (v4 for Snapshot Serengeti) to determine appropriate images from a sequence to keep (only one per sequence to avoid testing on the same animal (instance) multiple times). \n",
|
| 2108 |
+
"\n",
|
| 2109 |
+
"First, let's remove the images that have multiple animals, as indicated by the `url_dupe` column."
|
| 2110 |
+
]
|
| 2111 |
+
},
|
| 2112 |
+
{
|
| 2113 |
+
"cell_type": "code",
|
| 2114 |
+
"execution_count": 33,
|
| 2115 |
+
"metadata": {},
|
| 2116 |
+
"outputs": [
|
| 2117 |
+
{
|
| 2118 |
+
"data": {
|
| 2119 |
+
"text/html": [
|
| 2120 |
+
"<div>\n",
|
| 2121 |
+
"<style scoped>\n",
|
| 2122 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 2123 |
+
" vertical-align: middle;\n",
|
| 2124 |
+
" }\n",
|
| 2125 |
+
"\n",
|
| 2126 |
+
" .dataframe tbody tr th {\n",
|
| 2127 |
+
" vertical-align: top;\n",
|
| 2128 |
+
" }\n",
|
| 2129 |
+
"\n",
|
| 2130 |
+
" .dataframe thead th {\n",
|
| 2131 |
+
" text-align: right;\n",
|
| 2132 |
+
" }\n",
|
| 2133 |
+
"</style>\n",
|
| 2134 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 2135 |
+
" <thead>\n",
|
| 2136 |
+
" <tr style=\"text-align: right;\">\n",
|
| 2137 |
+
" <th></th>\n",
|
| 2138 |
+
" <th>dataset_name</th>\n",
|
| 2139 |
+
" <th>url</th>\n",
|
| 2140 |
+
" <th>image_id</th>\n",
|
| 2141 |
+
" <th>sequence_id</th>\n",
|
| 2142 |
+
" <th>location_id</th>\n",
|
| 2143 |
+
" <th>frame_num</th>\n",
|
| 2144 |
+
" <th>original_label</th>\n",
|
| 2145 |
+
" <th>scientific_name</th>\n",
|
| 2146 |
+
" <th>common_name</th>\n",
|
| 2147 |
+
" <th>datetime</th>\n",
|
| 2148 |
+
" <th>...</th>\n",
|
| 2149 |
+
" <th>infraorder</th>\n",
|
| 2150 |
+
" <th>superfamily</th>\n",
|
| 2151 |
+
" <th>family</th>\n",
|
| 2152 |
+
" <th>subfamily</th>\n",
|
| 2153 |
+
" <th>tribe</th>\n",
|
| 2154 |
+
" <th>genus</th>\n",
|
| 2155 |
+
" <th>species</th>\n",
|
| 2156 |
+
" <th>subspecies</th>\n",
|
| 2157 |
+
" <th>variety</th>\n",
|
| 2158 |
+
" <th>url_dupe</th>\n",
|
| 2159 |
+
" </tr>\n",
|
| 2160 |
+
" </thead>\n",
|
| 2161 |
+
" <tbody>\n",
|
| 2162 |
+
" <tr>\n",
|
| 2163 |
+
" <th>1</th>\n",
|
| 2164 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2165 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2166 |
+
" <td>Caltech Camera Traps : 5a0b016f-23d2-11e8-a6a3...</td>\n",
|
| 2167 |
+
" <td>Caltech Camera Traps : 6f27ed66-5567-11e8-9e92...</td>\n",
|
| 2168 |
+
" <td>Caltech Camera Traps : 26</td>\n",
|
| 2169 |
+
" <td>1</td>\n",
|
| 2170 |
+
" <td>deer</td>\n",
|
| 2171 |
+
" <td>odocoileus</td>\n",
|
| 2172 |
+
" <td>deer</td>\n",
|
| 2173 |
+
" <td>11-04-2013 18:37:07</td>\n",
|
| 2174 |
+
" <td>...</td>\n",
|
| 2175 |
+
" <td>NaN</td>\n",
|
| 2176 |
+
" <td>NaN</td>\n",
|
| 2177 |
+
" <td>cervidae</td>\n",
|
| 2178 |
+
" <td>capreolinae</td>\n",
|
| 2179 |
+
" <td>odocoileini</td>\n",
|
| 2180 |
+
" <td>odocoileus</td>\n",
|
| 2181 |
+
" <td>NaN</td>\n",
|
| 2182 |
+
" <td>NaN</td>\n",
|
| 2183 |
+
" <td>NaN</td>\n",
|
| 2184 |
+
" <td>False</td>\n",
|
| 2185 |
+
" </tr>\n",
|
| 2186 |
+
" <tr>\n",
|
| 2187 |
+
" <th>2</th>\n",
|
| 2188 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2189 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2190 |
+
" <td>Caltech Camera Traps : 59b93afb-23d2-11e8-a6a3...</td>\n",
|
| 2191 |
+
" <td>Caltech Camera Traps : 6f04895c-5567-11e8-a3d6...</td>\n",
|
| 2192 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2193 |
+
" <td>2</td>\n",
|
| 2194 |
+
" <td>cat</td>\n",
|
| 2195 |
+
" <td>felis catus</td>\n",
|
| 2196 |
+
" <td>cat</td>\n",
|
| 2197 |
+
" <td>05-09-2012 07:33:45</td>\n",
|
| 2198 |
+
" <td>...</td>\n",
|
| 2199 |
+
" <td>NaN</td>\n",
|
| 2200 |
+
" <td>NaN</td>\n",
|
| 2201 |
+
" <td>felidae</td>\n",
|
| 2202 |
+
" <td>felinae</td>\n",
|
| 2203 |
+
" <td>NaN</td>\n",
|
| 2204 |
+
" <td>felis</td>\n",
|
| 2205 |
+
" <td>felis catus</td>\n",
|
| 2206 |
+
" <td>NaN</td>\n",
|
| 2207 |
+
" <td>NaN</td>\n",
|
| 2208 |
+
" <td>False</td>\n",
|
| 2209 |
+
" </tr>\n",
|
| 2210 |
+
" <tr>\n",
|
| 2211 |
+
" <th>3</th>\n",
|
| 2212 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2213 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2214 |
+
" <td>Caltech Camera Traps : 59641f56-23d2-11e8-a6a3...</td>\n",
|
| 2215 |
+
" <td>Caltech Camera Traps : 6f0385b5-5567-11e8-a80b...</td>\n",
|
| 2216 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2217 |
+
" <td>2</td>\n",
|
| 2218 |
+
" <td>opossum</td>\n",
|
| 2219 |
+
" <td>didelphis virginiana</td>\n",
|
| 2220 |
+
" <td>virginia opossum</td>\n",
|
| 2221 |
+
" <td>03-29-2012 02:34:13</td>\n",
|
| 2222 |
+
" <td>...</td>\n",
|
| 2223 |
+
" <td>NaN</td>\n",
|
| 2224 |
+
" <td>NaN</td>\n",
|
| 2225 |
+
" <td>didelphidae</td>\n",
|
| 2226 |
+
" <td>didelphinae</td>\n",
|
| 2227 |
+
" <td>didelphini</td>\n",
|
| 2228 |
+
" <td>didelphis</td>\n",
|
| 2229 |
+
" <td>didelphis virginiana</td>\n",
|
| 2230 |
+
" <td>NaN</td>\n",
|
| 2231 |
+
" <td>NaN</td>\n",
|
| 2232 |
+
" <td>False</td>\n",
|
| 2233 |
+
" </tr>\n",
|
| 2234 |
+
" <tr>\n",
|
| 2235 |
+
" <th>7</th>\n",
|
| 2236 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2237 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2238 |
+
" <td>Caltech Camera Traps : 5a217843-23d2-11e8-a6a3...</td>\n",
|
| 2239 |
+
" <td>Caltech Camera Traps : 70115511-5567-11e8-a1fd...</td>\n",
|
| 2240 |
+
" <td>Caltech Camera Traps : 41</td>\n",
|
| 2241 |
+
" <td>1</td>\n",
|
| 2242 |
+
" <td>deer</td>\n",
|
| 2243 |
+
" <td>odocoileus</td>\n",
|
| 2244 |
+
" <td>deer</td>\n",
|
| 2245 |
+
" <td>09-29-2012 18:14:45</td>\n",
|
| 2246 |
+
" <td>...</td>\n",
|
| 2247 |
+
" <td>NaN</td>\n",
|
| 2248 |
+
" <td>NaN</td>\n",
|
| 2249 |
+
" <td>cervidae</td>\n",
|
| 2250 |
+
" <td>capreolinae</td>\n",
|
| 2251 |
+
" <td>odocoileini</td>\n",
|
| 2252 |
+
" <td>odocoileus</td>\n",
|
| 2253 |
+
" <td>NaN</td>\n",
|
| 2254 |
+
" <td>NaN</td>\n",
|
| 2255 |
+
" <td>NaN</td>\n",
|
| 2256 |
+
" <td>False</td>\n",
|
| 2257 |
+
" </tr>\n",
|
| 2258 |
+
" <tr>\n",
|
| 2259 |
+
" <th>8</th>\n",
|
| 2260 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2261 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2262 |
+
" <td>Caltech Camera Traps : 5a2176e7-23d2-11e8-a6a3...</td>\n",
|
| 2263 |
+
" <td>Caltech Camera Traps : 6f011019-5567-11e8-a650...</td>\n",
|
| 2264 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2265 |
+
" <td>2</td>\n",
|
| 2266 |
+
" <td>dog</td>\n",
|
| 2267 |
+
" <td>canis familiaris</td>\n",
|
| 2268 |
+
" <td>domestic dog</td>\n",
|
| 2269 |
+
" <td>11-29-2011 17:28:26</td>\n",
|
| 2270 |
+
" <td>...</td>\n",
|
| 2271 |
+
" <td>NaN</td>\n",
|
| 2272 |
+
" <td>NaN</td>\n",
|
| 2273 |
+
" <td>canidae</td>\n",
|
| 2274 |
+
" <td>NaN</td>\n",
|
| 2275 |
+
" <td>NaN</td>\n",
|
| 2276 |
+
" <td>canis</td>\n",
|
| 2277 |
+
" <td>canis familiaris</td>\n",
|
| 2278 |
+
" <td>NaN</td>\n",
|
| 2279 |
+
" <td>NaN</td>\n",
|
| 2280 |
+
" <td>False</td>\n",
|
| 2281 |
+
" </tr>\n",
|
| 2282 |
+
" </tbody>\n",
|
| 2283 |
+
"</table>\n",
|
| 2284 |
+
"<p>5 rows × 31 columns</p>\n",
|
| 2285 |
+
"</div>"
|
| 2286 |
+
],
|
| 2287 |
+
"text/plain": [
|
| 2288 |
+
" dataset_name url \n",
|
| 2289 |
+
"1 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \\\n",
|
| 2290 |
+
"2 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2291 |
+
"3 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2292 |
+
"7 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2293 |
+
"8 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2294 |
+
"\n",
|
| 2295 |
+
" image_id \n",
|
| 2296 |
+
"1 Caltech Camera Traps : 5a0b016f-23d2-11e8-a6a3... \\\n",
|
| 2297 |
+
"2 Caltech Camera Traps : 59b93afb-23d2-11e8-a6a3... \n",
|
| 2298 |
+
"3 Caltech Camera Traps : 59641f56-23d2-11e8-a6a3... \n",
|
| 2299 |
+
"7 Caltech Camera Traps : 5a217843-23d2-11e8-a6a3... \n",
|
| 2300 |
+
"8 Caltech Camera Traps : 5a2176e7-23d2-11e8-a6a3... \n",
|
| 2301 |
+
"\n",
|
| 2302 |
+
" sequence_id \n",
|
| 2303 |
+
"1 Caltech Camera Traps : 6f27ed66-5567-11e8-9e92... \\\n",
|
| 2304 |
+
"2 Caltech Camera Traps : 6f04895c-5567-11e8-a3d6... \n",
|
| 2305 |
+
"3 Caltech Camera Traps : 6f0385b5-5567-11e8-a80b... \n",
|
| 2306 |
+
"7 Caltech Camera Traps : 70115511-5567-11e8-a1fd... \n",
|
| 2307 |
+
"8 Caltech Camera Traps : 6f011019-5567-11e8-a650... \n",
|
| 2308 |
+
"\n",
|
| 2309 |
+
" location_id frame_num original_label scientific_name \n",
|
| 2310 |
+
"1 Caltech Camera Traps : 26 1 deer odocoileus \\\n",
|
| 2311 |
+
"2 Caltech Camera Traps : 38 2 cat felis catus \n",
|
| 2312 |
+
"3 Caltech Camera Traps : 38 2 opossum didelphis virginiana \n",
|
| 2313 |
+
"7 Caltech Camera Traps : 41 1 deer odocoileus \n",
|
| 2314 |
+
"8 Caltech Camera Traps : 38 2 dog canis familiaris \n",
|
| 2315 |
+
"\n",
|
| 2316 |
+
" common_name datetime ... infraorder superfamily \n",
|
| 2317 |
+
"1 deer 11-04-2013 18:37:07 ... NaN NaN \\\n",
|
| 2318 |
+
"2 cat 05-09-2012 07:33:45 ... NaN NaN \n",
|
| 2319 |
+
"3 virginia opossum 03-29-2012 02:34:13 ... NaN NaN \n",
|
| 2320 |
+
"7 deer 09-29-2012 18:14:45 ... NaN NaN \n",
|
| 2321 |
+
"8 domestic dog 11-29-2011 17:28:26 ... NaN NaN \n",
|
| 2322 |
+
"\n",
|
| 2323 |
+
" family subfamily tribe genus species \n",
|
| 2324 |
+
"1 cervidae capreolinae odocoileini odocoileus NaN \\\n",
|
| 2325 |
+
"2 felidae felinae NaN felis felis catus \n",
|
| 2326 |
+
"3 didelphidae didelphinae didelphini didelphis didelphis virginiana \n",
|
| 2327 |
+
"7 cervidae capreolinae odocoileini odocoileus NaN \n",
|
| 2328 |
+
"8 canidae NaN NaN canis canis familiaris \n",
|
| 2329 |
+
"\n",
|
| 2330 |
+
" subspecies variety url_dupe \n",
|
| 2331 |
+
"1 NaN NaN False \n",
|
| 2332 |
+
"2 NaN NaN False \n",
|
| 2333 |
+
"3 NaN NaN False \n",
|
| 2334 |
+
"7 NaN NaN False \n",
|
| 2335 |
+
"8 NaN NaN False \n",
|
| 2336 |
+
"\n",
|
| 2337 |
+
"[5 rows x 31 columns]"
|
| 2338 |
+
]
|
| 2339 |
+
},
|
| 2340 |
+
"execution_count": 33,
|
| 2341 |
+
"metadata": {},
|
| 2342 |
+
"output_type": "execute_result"
|
| 2343 |
+
}
|
| 2344 |
+
],
|
| 2345 |
+
"source": [
|
| 2346 |
+
"dedupe_genusSpecies = df_genusSpecies.loc[~df_genusSpecies.url_dupe]\n",
|
| 2347 |
+
"dedupe_genusSpecies.head()"
|
| 2348 |
+
]
|
| 2349 |
+
},
|
| 2350 |
+
{
|
| 2351 |
+
"cell_type": "markdown",
|
| 2352 |
+
"metadata": {},
|
| 2353 |
+
"source": [
|
| 2354 |
+
"Let's quickly check our stats on this subset (eg, `speices`/`genus` values)."
|
| 2355 |
+
]
|
| 2356 |
+
},
|
| 2357 |
+
{
|
| 2358 |
+
"cell_type": "code",
|
| 2359 |
+
"execution_count": 34,
|
| 2360 |
+
"metadata": {},
|
| 2361 |
+
"outputs": [
|
| 2362 |
+
{
|
| 2363 |
+
"name": "stdout",
|
| 2364 |
+
"output_type": "stream",
|
| 2365 |
+
"text": [
|
| 2366 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 2367 |
+
"Index: 6825717 entries, 1 to 16833847\n",
|
| 2368 |
+
"Data columns (total 31 columns):\n",
|
| 2369 |
+
" # Column Non-Null Count Dtype \n",
|
| 2370 |
+
"--- ------ -------------- ----- \n",
|
| 2371 |
+
" 0 dataset_name 6825717 non-null object\n",
|
| 2372 |
+
" 1 url 6825717 non-null object\n",
|
| 2373 |
+
" 2 image_id 6825717 non-null object\n",
|
| 2374 |
+
" 3 sequence_id 6825717 non-null object\n",
|
| 2375 |
+
" 4 location_id 6825717 non-null object\n",
|
| 2376 |
+
" 5 frame_num 6825717 non-null int64 \n",
|
| 2377 |
+
" 6 original_label 6825717 non-null object\n",
|
| 2378 |
+
" 7 scientific_name 6825717 non-null object\n",
|
| 2379 |
+
" 8 common_name 6825717 non-null object\n",
|
| 2380 |
+
" 9 datetime 3871189 non-null object\n",
|
| 2381 |
+
" 10 annotation_level 6825717 non-null object\n",
|
| 2382 |
+
" 11 kingdom 6825717 non-null object\n",
|
| 2383 |
+
" 12 phylum 6825717 non-null object\n",
|
| 2384 |
+
" 13 subphylum 6825717 non-null object\n",
|
| 2385 |
+
" 14 superclass 39 non-null object\n",
|
| 2386 |
+
" 15 class 6825717 non-null object\n",
|
| 2387 |
+
" 16 subclass 6640843 non-null object\n",
|
| 2388 |
+
" 17 infraclass 6640804 non-null object\n",
|
| 2389 |
+
" 18 superorder 6603873 non-null object\n",
|
| 2390 |
+
" 19 order 6825717 non-null object\n",
|
| 2391 |
+
" 20 suborder 5592452 non-null object\n",
|
| 2392 |
+
" 21 infraorder 506319 non-null object\n",
|
| 2393 |
+
" 22 superfamily 344989 non-null object\n",
|
| 2394 |
+
" 23 family 6825717 non-null object\n",
|
| 2395 |
+
" 24 subfamily 5701678 non-null object\n",
|
| 2396 |
+
" 25 tribe 5073268 non-null object\n",
|
| 2397 |
+
" 26 genus 6825717 non-null object\n",
|
| 2398 |
+
" 27 species 6365985 non-null object\n",
|
| 2399 |
+
" 28 subspecies 20249 non-null object\n",
|
| 2400 |
+
" 29 variety 1141 non-null object\n",
|
| 2401 |
+
" 30 url_dupe 6825717 non-null bool \n",
|
| 2402 |
+
"dtypes: bool(1), int64(1), object(29)\n",
|
| 2403 |
+
"memory usage: 1.6+ GB\n"
|
| 2404 |
+
]
|
| 2405 |
+
}
|
| 2406 |
+
],
|
| 2407 |
+
"source": [
|
| 2408 |
+
"dedupe_genusSpecies.info(show_counts = True)"
|
| 2409 |
+
]
|
| 2410 |
+
},
|
| 2411 |
+
{
|
| 2412 |
+
"cell_type": "code",
|
| 2413 |
+
"execution_count": 39,
|
| 2414 |
+
"metadata": {},
|
| 2415 |
+
"outputs": [
|
| 2416 |
+
{
|
| 2417 |
+
"data": {
|
| 2418 |
+
"text/plain": [
|
| 2419 |
+
"dataset_name 18\n",
|
| 2420 |
+
"url 6825717\n",
|
| 2421 |
+
"image_id 6825717\n",
|
| 2422 |
+
"sequence_id 1021256\n",
|
| 2423 |
+
"location_id 6017\n",
|
| 2424 |
+
"frame_num 6068\n",
|
| 2425 |
+
"original_label 972\n",
|
| 2426 |
+
"scientific_name 754\n",
|
| 2427 |
+
"common_name 815\n",
|
| 2428 |
+
"datetime 2549108\n",
|
| 2429 |
+
"annotation_level 3\n",
|
| 2430 |
+
"genus 476\n",
|
| 2431 |
+
"species 667\n",
|
| 2432 |
+
"dtype: int64"
|
| 2433 |
+
]
|
| 2434 |
+
},
|
| 2435 |
+
"execution_count": 39,
|
| 2436 |
+
"metadata": {},
|
| 2437 |
+
"output_type": "execute_result"
|
| 2438 |
+
}
|
| 2439 |
+
],
|
| 2440 |
+
"source": [
|
| 2441 |
+
"cols = list(dedupe_genusSpecies.columns[:11])\n",
|
| 2442 |
+
"cols.append('genus')\n",
|
| 2443 |
+
"cols.append('species')\n",
|
| 2444 |
+
"dedupe_genusSpecies[cols].nunique()"
|
| 2445 |
+
]
|
| 2446 |
+
},
|
| 2447 |
+
{
|
| 2448 |
+
"cell_type": "markdown",
|
| 2449 |
+
"metadata": {},
|
| 2450 |
+
"source": [
|
| 2451 |
+
"All datasets are still represented, all URLs and `image_id`s are unique, and we still have 667 distinct species. \n",
|
| 2452 |
+
"\n",
|
| 2453 |
+
"We should probably drop the null `species` values since we have such a large number of images and prefer to keep it more specific."
|
| 2454 |
+
]
|
| 2455 |
+
},
|
| 2456 |
+
{
|
| 2457 |
+
"cell_type": "code",
|
| 2458 |
+
"execution_count": 40,
|
| 2459 |
+
"metadata": {},
|
| 2460 |
+
"outputs": [
|
| 2461 |
+
{
|
| 2462 |
+
"data": {
|
| 2463 |
+
"text/html": [
|
| 2464 |
+
"<div>\n",
|
| 2465 |
+
"<style scoped>\n",
|
| 2466 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 2467 |
+
" vertical-align: middle;\n",
|
| 2468 |
+
" }\n",
|
| 2469 |
+
"\n",
|
| 2470 |
+
" .dataframe tbody tr th {\n",
|
| 2471 |
+
" vertical-align: top;\n",
|
| 2472 |
+
" }\n",
|
| 2473 |
+
"\n",
|
| 2474 |
+
" .dataframe thead th {\n",
|
| 2475 |
+
" text-align: right;\n",
|
| 2476 |
+
" }\n",
|
| 2477 |
+
"</style>\n",
|
| 2478 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 2479 |
+
" <thead>\n",
|
| 2480 |
+
" <tr style=\"text-align: right;\">\n",
|
| 2481 |
+
" <th></th>\n",
|
| 2482 |
+
" <th>dataset_name</th>\n",
|
| 2483 |
+
" <th>url</th>\n",
|
| 2484 |
+
" <th>image_id</th>\n",
|
| 2485 |
+
" <th>sequence_id</th>\n",
|
| 2486 |
+
" <th>location_id</th>\n",
|
| 2487 |
+
" <th>frame_num</th>\n",
|
| 2488 |
+
" <th>original_label</th>\n",
|
| 2489 |
+
" <th>scientific_name</th>\n",
|
| 2490 |
+
" <th>common_name</th>\n",
|
| 2491 |
+
" <th>datetime</th>\n",
|
| 2492 |
+
" <th>...</th>\n",
|
| 2493 |
+
" <th>infraorder</th>\n",
|
| 2494 |
+
" <th>superfamily</th>\n",
|
| 2495 |
+
" <th>family</th>\n",
|
| 2496 |
+
" <th>subfamily</th>\n",
|
| 2497 |
+
" <th>tribe</th>\n",
|
| 2498 |
+
" <th>genus</th>\n",
|
| 2499 |
+
" <th>species</th>\n",
|
| 2500 |
+
" <th>subspecies</th>\n",
|
| 2501 |
+
" <th>variety</th>\n",
|
| 2502 |
+
" <th>url_dupe</th>\n",
|
| 2503 |
+
" </tr>\n",
|
| 2504 |
+
" </thead>\n",
|
| 2505 |
+
" <tbody>\n",
|
| 2506 |
+
" <tr>\n",
|
| 2507 |
+
" <th>2</th>\n",
|
| 2508 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2509 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2510 |
+
" <td>Caltech Camera Traps : 59b93afb-23d2-11e8-a6a3...</td>\n",
|
| 2511 |
+
" <td>Caltech Camera Traps : 6f04895c-5567-11e8-a3d6...</td>\n",
|
| 2512 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2513 |
+
" <td>2</td>\n",
|
| 2514 |
+
" <td>cat</td>\n",
|
| 2515 |
+
" <td>felis catus</td>\n",
|
| 2516 |
+
" <td>cat</td>\n",
|
| 2517 |
+
" <td>05-09-2012 07:33:45</td>\n",
|
| 2518 |
+
" <td>...</td>\n",
|
| 2519 |
+
" <td>NaN</td>\n",
|
| 2520 |
+
" <td>NaN</td>\n",
|
| 2521 |
+
" <td>felidae</td>\n",
|
| 2522 |
+
" <td>felinae</td>\n",
|
| 2523 |
+
" <td>NaN</td>\n",
|
| 2524 |
+
" <td>felis</td>\n",
|
| 2525 |
+
" <td>felis catus</td>\n",
|
| 2526 |
+
" <td>NaN</td>\n",
|
| 2527 |
+
" <td>NaN</td>\n",
|
| 2528 |
+
" <td>False</td>\n",
|
| 2529 |
+
" </tr>\n",
|
| 2530 |
+
" <tr>\n",
|
| 2531 |
+
" <th>3</th>\n",
|
| 2532 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2533 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2534 |
+
" <td>Caltech Camera Traps : 59641f56-23d2-11e8-a6a3...</td>\n",
|
| 2535 |
+
" <td>Caltech Camera Traps : 6f0385b5-5567-11e8-a80b...</td>\n",
|
| 2536 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2537 |
+
" <td>2</td>\n",
|
| 2538 |
+
" <td>opossum</td>\n",
|
| 2539 |
+
" <td>didelphis virginiana</td>\n",
|
| 2540 |
+
" <td>virginia opossum</td>\n",
|
| 2541 |
+
" <td>03-29-2012 02:34:13</td>\n",
|
| 2542 |
+
" <td>...</td>\n",
|
| 2543 |
+
" <td>NaN</td>\n",
|
| 2544 |
+
" <td>NaN</td>\n",
|
| 2545 |
+
" <td>didelphidae</td>\n",
|
| 2546 |
+
" <td>didelphinae</td>\n",
|
| 2547 |
+
" <td>didelphini</td>\n",
|
| 2548 |
+
" <td>didelphis</td>\n",
|
| 2549 |
+
" <td>didelphis virginiana</td>\n",
|
| 2550 |
+
" <td>NaN</td>\n",
|
| 2551 |
+
" <td>NaN</td>\n",
|
| 2552 |
+
" <td>False</td>\n",
|
| 2553 |
+
" </tr>\n",
|
| 2554 |
+
" <tr>\n",
|
| 2555 |
+
" <th>8</th>\n",
|
| 2556 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2557 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2558 |
+
" <td>Caltech Camera Traps : 5a2176e7-23d2-11e8-a6a3...</td>\n",
|
| 2559 |
+
" <td>Caltech Camera Traps : 6f011019-5567-11e8-a650...</td>\n",
|
| 2560 |
+
" <td>Caltech Camera Traps : 38</td>\n",
|
| 2561 |
+
" <td>2</td>\n",
|
| 2562 |
+
" <td>dog</td>\n",
|
| 2563 |
+
" <td>canis familiaris</td>\n",
|
| 2564 |
+
" <td>domestic dog</td>\n",
|
| 2565 |
+
" <td>11-29-2011 17:28:26</td>\n",
|
| 2566 |
+
" <td>...</td>\n",
|
| 2567 |
+
" <td>NaN</td>\n",
|
| 2568 |
+
" <td>NaN</td>\n",
|
| 2569 |
+
" <td>canidae</td>\n",
|
| 2570 |
+
" <td>NaN</td>\n",
|
| 2571 |
+
" <td>NaN</td>\n",
|
| 2572 |
+
" <td>canis</td>\n",
|
| 2573 |
+
" <td>canis familiaris</td>\n",
|
| 2574 |
+
" <td>NaN</td>\n",
|
| 2575 |
+
" <td>NaN</td>\n",
|
| 2576 |
+
" <td>False</td>\n",
|
| 2577 |
+
" </tr>\n",
|
| 2578 |
+
" <tr>\n",
|
| 2579 |
+
" <th>10</th>\n",
|
| 2580 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2581 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2582 |
+
" <td>Caltech Camera Traps : 598de824-23d2-11e8-a6a3...</td>\n",
|
| 2583 |
+
" <td>Caltech Camera Traps : 6f8257b0-5567-11e8-b82e...</td>\n",
|
| 2584 |
+
" <td>Caltech Camera Traps : 57</td>\n",
|
| 2585 |
+
" <td>1</td>\n",
|
| 2586 |
+
" <td>raccoon</td>\n",
|
| 2587 |
+
" <td>procyon lotor</td>\n",
|
| 2588 |
+
" <td>raccoon</td>\n",
|
| 2589 |
+
" <td>12-25-2013 21:48:54</td>\n",
|
| 2590 |
+
" <td>...</td>\n",
|
| 2591 |
+
" <td>NaN</td>\n",
|
| 2592 |
+
" <td>NaN</td>\n",
|
| 2593 |
+
" <td>procyonidae</td>\n",
|
| 2594 |
+
" <td>NaN</td>\n",
|
| 2595 |
+
" <td>NaN</td>\n",
|
| 2596 |
+
" <td>procyon</td>\n",
|
| 2597 |
+
" <td>procyon lotor</td>\n",
|
| 2598 |
+
" <td>NaN</td>\n",
|
| 2599 |
+
" <td>NaN</td>\n",
|
| 2600 |
+
" <td>False</td>\n",
|
| 2601 |
+
" </tr>\n",
|
| 2602 |
+
" <tr>\n",
|
| 2603 |
+
" <th>14</th>\n",
|
| 2604 |
+
" <td>Caltech Camera Traps</td>\n",
|
| 2605 |
+
" <td>https://lilablobssc.blob.core.windows.net/calt...</td>\n",
|
| 2606 |
+
" <td>Caltech Camera Traps : 5a1cb0d8-23d2-11e8-a6a3...</td>\n",
|
| 2607 |
+
" <td>Caltech Camera Traps : 6f18c3eb-5567-11e8-8b81...</td>\n",
|
| 2608 |
+
" <td>Caltech Camera Traps : 46</td>\n",
|
| 2609 |
+
" <td>2</td>\n",
|
| 2610 |
+
" <td>opossum</td>\n",
|
| 2611 |
+
" <td>didelphis virginiana</td>\n",
|
| 2612 |
+
" <td>virginia opossum</td>\n",
|
| 2613 |
+
" <td>04-19-2012 22:13:23</td>\n",
|
| 2614 |
+
" <td>...</td>\n",
|
| 2615 |
+
" <td>NaN</td>\n",
|
| 2616 |
+
" <td>NaN</td>\n",
|
| 2617 |
+
" <td>didelphidae</td>\n",
|
| 2618 |
+
" <td>didelphinae</td>\n",
|
| 2619 |
+
" <td>didelphini</td>\n",
|
| 2620 |
+
" <td>didelphis</td>\n",
|
| 2621 |
+
" <td>didelphis virginiana</td>\n",
|
| 2622 |
+
" <td>NaN</td>\n",
|
| 2623 |
+
" <td>NaN</td>\n",
|
| 2624 |
+
" <td>False</td>\n",
|
| 2625 |
+
" </tr>\n",
|
| 2626 |
+
" </tbody>\n",
|
| 2627 |
+
"</table>\n",
|
| 2628 |
+
"<p>5 rows × 31 columns</p>\n",
|
| 2629 |
+
"</div>"
|
| 2630 |
+
],
|
| 2631 |
+
"text/plain": [
|
| 2632 |
+
" dataset_name url \n",
|
| 2633 |
+
"2 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \\\n",
|
| 2634 |
+
"3 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2635 |
+
"8 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2636 |
+
"10 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2637 |
+
"14 Caltech Camera Traps https://lilablobssc.blob.core.windows.net/calt... \n",
|
| 2638 |
+
"\n",
|
| 2639 |
+
" image_id \n",
|
| 2640 |
+
"2 Caltech Camera Traps : 59b93afb-23d2-11e8-a6a3... \\\n",
|
| 2641 |
+
"3 Caltech Camera Traps : 59641f56-23d2-11e8-a6a3... \n",
|
| 2642 |
+
"8 Caltech Camera Traps : 5a2176e7-23d2-11e8-a6a3... \n",
|
| 2643 |
+
"10 Caltech Camera Traps : 598de824-23d2-11e8-a6a3... \n",
|
| 2644 |
+
"14 Caltech Camera Traps : 5a1cb0d8-23d2-11e8-a6a3... \n",
|
| 2645 |
+
"\n",
|
| 2646 |
+
" sequence_id \n",
|
| 2647 |
+
"2 Caltech Camera Traps : 6f04895c-5567-11e8-a3d6... \\\n",
|
| 2648 |
+
"3 Caltech Camera Traps : 6f0385b5-5567-11e8-a80b... \n",
|
| 2649 |
+
"8 Caltech Camera Traps : 6f011019-5567-11e8-a650... \n",
|
| 2650 |
+
"10 Caltech Camera Traps : 6f8257b0-5567-11e8-b82e... \n",
|
| 2651 |
+
"14 Caltech Camera Traps : 6f18c3eb-5567-11e8-8b81... \n",
|
| 2652 |
+
"\n",
|
| 2653 |
+
" location_id frame_num original_label scientific_name \n",
|
| 2654 |
+
"2 Caltech Camera Traps : 38 2 cat felis catus \\\n",
|
| 2655 |
+
"3 Caltech Camera Traps : 38 2 opossum didelphis virginiana \n",
|
| 2656 |
+
"8 Caltech Camera Traps : 38 2 dog canis familiaris \n",
|
| 2657 |
+
"10 Caltech Camera Traps : 57 1 raccoon procyon lotor \n",
|
| 2658 |
+
"14 Caltech Camera Traps : 46 2 opossum didelphis virginiana \n",
|
| 2659 |
+
"\n",
|
| 2660 |
+
" common_name datetime ... infraorder superfamily \n",
|
| 2661 |
+
"2 cat 05-09-2012 07:33:45 ... NaN NaN \\\n",
|
| 2662 |
+
"3 virginia opossum 03-29-2012 02:34:13 ... NaN NaN \n",
|
| 2663 |
+
"8 domestic dog 11-29-2011 17:28:26 ... NaN NaN \n",
|
| 2664 |
+
"10 raccoon 12-25-2013 21:48:54 ... NaN NaN \n",
|
| 2665 |
+
"14 virginia opossum 04-19-2012 22:13:23 ... NaN NaN \n",
|
| 2666 |
+
"\n",
|
| 2667 |
+
" family subfamily tribe genus species \n",
|
| 2668 |
+
"2 felidae felinae NaN felis felis catus \\\n",
|
| 2669 |
+
"3 didelphidae didelphinae didelphini didelphis didelphis virginiana \n",
|
| 2670 |
+
"8 canidae NaN NaN canis canis familiaris \n",
|
| 2671 |
+
"10 procyonidae NaN NaN procyon procyon lotor \n",
|
| 2672 |
+
"14 didelphidae didelphinae didelphini didelphis didelphis virginiana \n",
|
| 2673 |
+
"\n",
|
| 2674 |
+
" subspecies variety url_dupe \n",
|
| 2675 |
+
"2 NaN NaN False \n",
|
| 2676 |
+
"3 NaN NaN False \n",
|
| 2677 |
+
"8 NaN NaN False \n",
|
| 2678 |
+
"10 NaN NaN False \n",
|
| 2679 |
+
"14 NaN NaN False \n",
|
| 2680 |
+
"\n",
|
| 2681 |
+
"[5 rows x 31 columns]"
|
| 2682 |
+
]
|
| 2683 |
+
},
|
| 2684 |
+
"execution_count": 40,
|
| 2685 |
+
"metadata": {},
|
| 2686 |
+
"output_type": "execute_result"
|
| 2687 |
+
}
|
| 2688 |
+
],
|
| 2689 |
+
"source": [
|
| 2690 |
+
"dedupe_species = dedupe_genusSpecies.loc[dedupe_genusSpecies.species.notna()]\n",
|
| 2691 |
+
"dedupe_species.head()"
|
| 2692 |
+
]
|
| 2693 |
+
},
|
| 2694 |
+
{
|
| 2695 |
+
"cell_type": "markdown",
|
| 2696 |
+
"metadata": {},
|
| 2697 |
+
"source": [
|
| 2698 |
+
"Have any of our other stats changed significantly?"
|
| 2699 |
+
]
|
| 2700 |
+
},
|
| 2701 |
+
{
|
| 2702 |
+
"cell_type": "code",
|
| 2703 |
+
"execution_count": 41,
|
| 2704 |
+
"metadata": {},
|
| 2705 |
+
"outputs": [
|
| 2706 |
+
{
|
| 2707 |
+
"name": "stdout",
|
| 2708 |
+
"output_type": "stream",
|
| 2709 |
+
"text": [
|
| 2710 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 2711 |
+
"Index: 6365985 entries, 2 to 16833847\n",
|
| 2712 |
+
"Data columns (total 13 columns):\n",
|
| 2713 |
+
" # Column Non-Null Count Dtype \n",
|
| 2714 |
+
"--- ------ -------------- ----- \n",
|
| 2715 |
+
" 0 dataset_name 6365985 non-null object\n",
|
| 2716 |
+
" 1 url 6365985 non-null object\n",
|
| 2717 |
+
" 2 image_id 6365985 non-null object\n",
|
| 2718 |
+
" 3 sequence_id 6365985 non-null object\n",
|
| 2719 |
+
" 4 location_id 6365985 non-null object\n",
|
| 2720 |
+
" 5 frame_num 6365985 non-null int64 \n",
|
| 2721 |
+
" 6 original_label 6365985 non-null object\n",
|
| 2722 |
+
" 7 scientific_name 6365985 non-null object\n",
|
| 2723 |
+
" 8 common_name 6365985 non-null object\n",
|
| 2724 |
+
" 9 datetime 3529288 non-null object\n",
|
| 2725 |
+
" 10 annotation_level 6365985 non-null object\n",
|
| 2726 |
+
" 11 genus 6365985 non-null object\n",
|
| 2727 |
+
" 12 species 6365985 non-null object\n",
|
| 2728 |
+
"dtypes: int64(1), object(12)\n",
|
| 2729 |
+
"memory usage: 680.0+ MB\n"
|
| 2730 |
+
]
|
| 2731 |
+
}
|
| 2732 |
+
],
|
| 2733 |
+
"source": [
|
| 2734 |
+
"dedupe_species[cols].info(show_counts = True)"
|
| 2735 |
+
]
|
| 2736 |
+
},
|
| 2737 |
+
{
|
| 2738 |
+
"cell_type": "code",
|
| 2739 |
+
"execution_count": 42,
|
| 2740 |
+
"metadata": {},
|
| 2741 |
+
"outputs": [
|
| 2742 |
+
{
|
| 2743 |
+
"data": {
|
| 2744 |
+
"text/plain": [
|
| 2745 |
+
"dataset_name 18\n",
|
| 2746 |
+
"url 6365985\n",
|
| 2747 |
+
"image_id 6365985\n",
|
| 2748 |
+
"sequence_id 948156\n",
|
| 2749 |
+
"location_id 6000\n",
|
| 2750 |
+
"frame_num 6065\n",
|
| 2751 |
+
"original_label 874\n",
|
| 2752 |
+
"scientific_name 673\n",
|
| 2753 |
+
"common_name 729\n",
|
| 2754 |
+
"datetime 2245289\n",
|
| 2755 |
+
"annotation_level 3\n",
|
| 2756 |
+
"genus 452\n",
|
| 2757 |
+
"species 667\n",
|
| 2758 |
+
"dtype: int64"
|
| 2759 |
+
]
|
| 2760 |
+
},
|
| 2761 |
+
"execution_count": 42,
|
| 2762 |
+
"metadata": {},
|
| 2763 |
+
"output_type": "execute_result"
|
| 2764 |
+
}
|
| 2765 |
+
],
|
| 2766 |
+
"source": [
|
| 2767 |
+
"dedupe_species[cols].nunique()"
|
| 2768 |
+
]
|
| 2769 |
+
},
|
| 2770 |
+
{
|
| 2771 |
+
"cell_type": "markdown",
|
| 2772 |
+
"metadata": {},
|
| 2773 |
+
"source": [
|
| 2774 |
+
"We lost 17 locations, 24 genera, and 86 common names, but all datasets are still represented."
|
| 2775 |
+
]
|
| 2776 |
+
},
|
| 2777 |
+
{
|
| 2778 |
+
"cell_type": "code",
|
| 2779 |
+
"execution_count": 44,
|
| 2780 |
+
"metadata": {},
|
| 2781 |
+
"outputs": [
|
| 2782 |
+
{
|
| 2783 |
+
"data": {
|
| 2784 |
+
"text/plain": [
|
| 2785 |
+
"array(['https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/59b93afb-23d2-11e8-a6a3-ec086b02610b.jpg',\n",
|
| 2786 |
+
" 'https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/59641f56-23d2-11e8-a6a3-ec086b02610b.jpg',\n",
|
| 2787 |
+
" 'https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/5a2176e7-23d2-11e8-a6a3-ec086b02610b.jpg',\n",
|
| 2788 |
+
" 'https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/598de824-23d2-11e8-a6a3-ec086b02610b.jpg',\n",
|
| 2789 |
+
" 'https://lilablobssc.blob.core.windows.net/caltech-unzipped/cct_images/5a1cb0d8-23d2-11e8-a6a3-ec086b02610b.jpg'],\n",
|
| 2790 |
+
" dtype=object)"
|
| 2791 |
+
]
|
| 2792 |
+
},
|
| 2793 |
+
"execution_count": 44,
|
| 2794 |
+
"metadata": {},
|
| 2795 |
+
"output_type": "execute_result"
|
| 2796 |
+
}
|
| 2797 |
+
],
|
| 2798 |
+
"source": [
|
| 2799 |
+
"#some sample images\n",
|
| 2800 |
+
"dedupe_species['url'].head().values"
|
| 2801 |
+
]
|
| 2802 |
+
},
|
| 2803 |
{
|
| 2804 |
"cell_type": "code",
|
| 2805 |
"execution_count": null,
|