DinoDataLab



In [1]:
import pandas as pd
import matplotlib.pyplot as plt

dinos = pd.read_json("dino_hash.json")

In [2]:
dinos.head()


Out[2]:
sha256
Aachenosaurus 986d800628ddd3c618c4efa09e31a0dac113379cffd237...
Aardonyx efb992d905e9c5d72ccc748803dac9b5983cfba7e101bf...
Abdallahsaurus 1f59e4db18ae3d34c6201b8694b3b3b3c17729ad6ccc9c...
Abelisaurus d187f165c20c6d658a3f3a4ec9214fca9cdaf456c7a6f0...
Abrictosaurus a7b2b5638ad7a94b45a40b4565acccb0691e0bd3db5fc8...

In [3]:
dinos.loc["Mo":"N"]


Out[3]:
sha256
Moabosaurus ac3fb2382fcc80ba710c8ef5622a0a5107a20d9d0a0fe5...
Mochlodon 8c50523a215283623278a95c24e59621cafb7d38b1ce31...
Mohammadisaurus 570daefe4c3f5b98cb6d8d038730dedf0d81f11965072d...
Mojoceratops af84e7ce23d22a05fa3f091f5ec868857c026c4477fb0c...
Mollusc 260f9022308318a9bcbaa848fb4fa81e6aa90b3c239045...
Mongolosaurus 3b8301f977ee7c6f274c3d19b94b1a70f51ca78c958f2e...
Monkonosaurus 0cd7f663d622ebd3a7786fe4665fa30762af04a2ddd7d3...
Monoclonius 46e526931fa4b7cbc212e78b93ae7d55b4e5bd6663ec68...
Monolophosaurus cf270f9583f8e2d01daf7d25d6ac0592d5dc605630edb6...
Mononychus 30f6c752269f811eeffd7e495a4572dc83ef624f489704...
Mononykus abb17ca61ff339e9f020e7d41e14ddd1727b7808472178...
Montanoceratops 724c3d481433f2e0e9e487816ddadfa0c48afb406d68e2...
Morinosaurus d34559476b9daeaffe8ccacc08a5a1794f9d2244770bbc...
Morosaurus 0692a0b8f3d71202a81e230d44cf1c0422f08007c93a0f...
Moshisaurus b9552df547b59337dc8ecb48611782baaebc9f83aa1ad8...
Mtapaiasaurus afe4c2b017ed3996bf5f4f3b937f0ae22e649df2f62078...
Mtotosaurus 61cfe000856807b74755e3427025cfe4273451ae6dafaf...
Mussaurus 202baec3895818232e347b0f2677f5b2197be8602b0420...
Muttaburrasaurus 0d54c8cbce58279fdcc7607142496e328d688b1bb05535...
Muyelensaurus 6550539e24a9ccecabe477b16fc28c58ab9e992133794f...
Mymoorapelta 5644e5d07e1e540c4781572e204fe5da1c94157ac53e32...

In [4]:
dinos.dtypes


Out[4]:
sha256    object
dtype: object

In [5]:
dinos.index.is_unique


Out[5]:
True

In [6]:
code = dinos.loc['Mtapaiasaurus'][0]

In [7]:
code


Out[7]:
'afe4c2b017ed3996bf5f4f3b937f0ae22e649df2f620787e136ed6bd3ea32e2d'

In [8]:
len(code)


Out[8]:
64

In [9]:
dinos.info()


<class 'pandas.core.frame.DataFrame'>
Index: 1449 entries, Aachenosaurus to Zupaysaurus
Data columns (total 1 columns):
sha256    1449 non-null object
dtypes: object(1)
memory usage: 62.6+ KB

In [10]:
int(code, base=16)


Out[10]:
79558933319102751775488401099621501352054498959766483830843801156598693572141

In [11]:
0xafe4c2b017ed3996bf5f4f3b937f0ae22e649df2f620787e136ed6bd3ea32e2d


Out[11]:
79558933319102751775488401099621501352054498959766483830843801156598693572141

LAB

Add a column to dinos that contains the decimal equivalent of the sha256 hash. Hint.


In [12]:
dinos.assign(Decimal = dinos.sha256.apply(lambda x: int(x, base=16)))


Out[12]:
sha256 Decimal
Aachenosaurus 986d800628ddd3c618c4efa09e31a0dac113379cffd237... 6894502290431315022067358956182627531339279740...
Aardonyx efb992d905e9c5d72ccc748803dac9b5983cfba7e101bf... 1084306510242824561324759833333105726121749006...
Abdallahsaurus 1f59e4db18ae3d34c6201b8694b3b3b3c17729ad6ccc9c... 1418052719984109540221646874510714834789312475...
Abelisaurus d187f165c20c6d658a3f3a4ec9214fca9cdaf456c7a6f0... 9477357577190764385360184919234382318008492011...
Abrictosaurus a7b2b5638ad7a94b45a40b4565acccb0691e0bd3db5fc8... 7585199639068134257420643095559770092125481753...
Abrosaurus aeeab7541293f1cff181a1b097eb52e34e3edffb8e0da8... 7911714315281995834377376717114968921922305931...
Abydosaurus 597c6b22f5bd9e180eea771b05c45e8203c2c54b9ae90b... 4047567198932003709189829629191863771750773805...
Acanthopholis f24fed14ee30e7746a40c0197528b7270a58711ac2c266... 1096009265534355244602537495296894988536680712...
Achelousaurus 5f2bd4bc7953216204592bdffd07990048c00399f899f4... 4304716329066825560115898044326888394670157146...
Achillesaurus 4747c387a97aa06cce0ce092ca7c847a2ac2d877d282a7... 3224100788898982606123222044717043958863151461...
Achillobator e7268d8d264328ac9494d5c149a6a66175d5eeec2ac59f... 1045523851628129865020630627992092658466065877...
Acracanthus ec148fd3893a4a413ec5d65306cad133dcfd3193bf819c... 1067821618596745362597423322465031543566440479...
Acristavus 45deda1a1775281b59e6fcbb457c03a52fff860d4cd2f0... 3160333188475877397363553015392885154738144315...
Acrocanthosaurus df97fe604383342a81d5eb2fc5a30e809b89cdac31d44d... 1011343147796868031343275298584147410018705165...
Acrotholus 092d071a907ebc057293674fa8c8cf8c67260130146ddc... 4150372783564571202429385098430304819597938642...
Actiosaurus 742da9458f01b348b01b10f20739b6e39aa3a3fc11a101... 5254896682400321316773342845111196607313327287...
Adamantisaurus 5998723cd713f5bdae734eb4d675156986cbd841e1d864... 4052519271708771088249032087371150026066414795...
Adasaurus 2d77883495da22251d3d6dc28190a55b12ef42a7fee719... 2056527304215727174638061725911668631667389789...
Adeopapposaurus 277693a2af74b36f6def0ce7ffaafb5ac10e5404055389... 1784970799109323580425447733642350557181521606...
Aegyptosaurus ed11f41584fb3f3ad4aa279e021775b2da56eb83edc691... 1072298661206074430034129775454102836835825064...
Aeolosaurus f71128d404c1cc7afd943f3915a0f3b783cc14f201cf39... 1117515917860315688692512761613530617861680941...
Aepisaurus 549745663908373c762424df141339d640d970bc93b4b5... 3826155216419458165073065334565988435418616862...
Aerosteon bb9f867a58e5312baed7e8f53bc53efaf9580274f3fffa... 8486435950085630687904729590684083244936895859...
Aetonyx 60e8a392607287450090d1398aa614f8476a0b73fa5684... 4383307091398599296402821602573832910657397504...
Afrovenator d577b42bc19baa79439cafc18559ec848a11f79cbe4fbf... 9655413504295380698198011853623817054159544125...
Agathaumas db41558168c8db257f58922e8ddec0e49ef155ad71a0be... 9917194903625363701173834988999972445085760466...
Aggiosaurus f361eae2a0b93f85d93e6374f9fc5e5060258d5e1759f6... 1100850274895365047526815790347032476928411979...
Agilisaurus b1f313d23b36d26e7cddf75ebd065bce6d1531519d1e18... 8048885483698466492701436266388516833661968834...
Agnosphitys 8989758a20e5b048f8fe033216fa8c66f99c8dc03dc3f0... 6220972953204183017150259865302426322383012942...
Agrosaurus 037827c40c51cea5d04aea093b1d0042fda38462dfd436... 1569234647077677915557742759564297100000340418...
... ... ...
Yezosaurus f0df33d2e84955f8f73db8825ca96c01cdfd4babbc8f05... 1089494482305446196132760956050381769951059258...
Yibinosaurus e7174d0e6fa7e270b5fdee0e1e1518f454900dd5907aca... 1045254373288911228333127201579213905302475127...
Yimenosaurus 4dd2e9c11f016365013bff4db5a1ddc5cc206ac58b4afa... 3520074053794873371414293200824852370752475298...
Yingshanosaurus 67c113890af980ef85635dc9e90b2d84feb37bd319e152... 4692935971542771136535804281589538189907284140...
Yinlong f60de1d305b881097d7fbede81a16a3012ef33bfe68453... 1112934883454048872043179088864797440455568358...
Yixianosaurus 5065f959f803635f54d5b707a057956b4649810a84dbe9... 3636520040059837426143522238313743462432963609...
Yizhousaurus 8614a57ef8dbb5721b0b176ef73a4d13f5c2fd938d24bc... 6064640086276159551297687175331089828585935556...
Yuanmouraptor dbbf70080ebd6787cf91a2684f6df9a53fd687d889308f... 9939475484193071288186780674278099293785094176...
Yuanmousaurus 8f584124795f418088c655ebaf38bfd5107b11a75f8f08... 6483666948596018604538530522818928042368695736...
Yubasaurus 747dd255d790e5b0875c543ccf171322d1d1f3940d1900... 5269059799978624178840769164411468389174646262...
Yueosaurus a516f454b4f40317b119a392fa697b90c3cf65efe6d7ac... 7467217696146480872293403877028202934453134199...
Yunnanosaurus c12c5db2c952c2fd43e748a0632344595ce859e21f0249... 8737476772990323694635673523383597447046022237...
Yunxiansaurus 08c65069d6eb07587f321dbbfc9bcbb476f9e2f3ec4674... 3968893500627910114048211855000853484035815972...
Yutyrannus 734f6da8ecc6374962b465ad3773dbb8c445f2ce430d98... 5215631534975120942933766312902106184378537114...
Zalmoxes e03010a7c4ecb91e3da98a6f7e5834ef560367b950b38f... 1014030016927522669159044089791166989715622066...
Zanclodon 3c0859943a21db2ecde573ac42226f6a9be489e92f2085... 2715352394313322201810903911522463466731075545...
Zapalasaurus eab0a15c58db5d699b38dd96953ed35821de58ce1efe01... 1061532853227199803294793542933499905362287420...
Zapsalis a54e3b1f7c1179d8202d7ba4cd6c0dab18859c368855be... 7476984213915038874165530650053414539745609908...
Zatomus d083a73ac3c56cfdb35eff176932ce8e30627df7fe8ab2... 9431368364673931096434685289590675464870795276...
Zephyrosaurus 15a24168c5405a625f3c4224dcc2930ebc880e825528e5... 9785250482862681961083046744599182949890360514...
Zhejiangosaurus 243b6c9486339fa9c7992ee6175d22aa875db141598988... 1638825591863015861163469357575184161778418903...
Zhongyuansaurus c1e0693238304a0382c48f3d3a44cc6f604d1719a29043... 8769287955636187073618794662613137776834847667...
Zhuchengceratops 00ade1605d501f61d2a79c50074de40b38d55ba3a06141... 3072200331165720577772253436954311096286676205...
Zhuchengosaurus d533147fd57f3ab253a82cd1c99b1b92cd26e66e222957... 9643288742986345808061336394004427232887909074...
Zhuchengtyrannus e2e96ff09821b33c507255ecbdebdfc79f2f0110653576... 1026351517261645929566252887803424951976051758...
Zigongosaurus 8acff7697952e1eb9ae8efc2b3abd8bdec5a257d34a083... 6278661802181882764711290181973775397101364274...
Zizhongosaurus bd26005122ef0350719ba58e783a2006f6916338d02d9e... 8555427075813354818608307289614151634287821883...
Zuniceratops a207158a914fa78bff188af9164edcdc01fa4f037eb972... 7328719807239157651978677573390725647215758894...
Zuolong dc1921e1ddb07fa7f58c2023cb360c123bd3c1266f991e... 9955323171190213304257152273492793923932632434...
Zupaysaurus 0ce18b6abf96c6e06939fe0899e50f6618767d8052c8b8... 5826256993247557452948070487564151831330643392...

1449 rows × 2 columns

LAB

Sort dinos by the column sha256 -- this will be an alphabetical sort.


In [13]:
dinos.sort_values(by='sha256').head(10)


Out[13]:
sha256
Protoceratops 001f5f55f762964016733ec2d9c0e3322e18c7533a331a...
Pellegrinisaurus 003d42e5e023c4b09009e7e5bd4b793cf5cd634a67c85a...
Shixinggia 006d15f1daa8904ee8e46a608b4d0aeaa779895d0613ef...
Lurdusaurus 00953f91c34086eb4b503010dcfb83460013bd1cbb792f...
Kryptops 00a9babe086ea3ac6a652dc1c3334fc9bc485cc6d1f9db...
Zhuchengceratops 00ade1605d501f61d2a79c50074de40b38d55ba3a06141...
Lapampasaurus 00baa9900d4f8f715f181ce732b7488ddeb0709556c5e8...
Tylocephale 00dad483f84b437d6e320eabb28e3b4e8f8e7525fff33a...
Gilmoreosaurus 01140e7356306eec7a90f4ba669feca7fb386af59fcb89...
Orodromeus 014f16f3abeeb6b3cf4b9dcaadfd357bfb697e93ae0e49...

How about in descending order?


In [14]:
dinos.sort_values(by='sha256', ascending=False).head(10)


Out[14]:
sha256
Avalonianus ffad0cfe78a1db7e3801f44a02307f1a4c23fcf7188bc2...
Platyceratops ff9a4f20e25679ab5e3f64fa69f5b25345d931a5fd847b...
Prenocephale fef1c818898fa33532cd527822e92e410fbf17483cb8c2...
Lourinhasaurus fee621f912181ce090a23cc321ac7487f06a1818f223e1...
Cryptodraco fee506e91a222211e23c19d98dd62f35a64460033c8c79...
Kentrosaurus feb25f28e47006a524509a5bbfe7f06ffde1d513f9f2fb...
Gasparinisaura fe7d197b0f2baf237eb567d10c48f11041884f5a8834ca...
Palaeosauriscus fe7ae756a5f48f4fdd196ea85cae80b28d0690ca3c32e4...
Pantydraco fe3bfa57375ccec196c5732c31d047dbb9878d8d5f40c2...
Australovenator fe1f43bfa5f74884c60cf592159ad0acdb0a91b8713569...