sourceName
stringclasses
1 value
url
stringclasses
20 values
action
stringclasses
1 value
body
stringlengths
23
1.11k
format
stringclasses
1 value
metadata
dict
title
stringclasses
20 values
updated
stringclasses
1 value
embedding
sequencelengths
384
384
devcenter
https://www.mongodb.com/developer/products/mongodb/build-go-web-application-gin-mongodb-help-ai
created
[4]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blta325fcc27ed55546/651482786fefa7183fc43138/image7.png [5]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltc8029e22c4381027/6514880ecf50bf3147fff13f/A7n71ej.gif [6]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt438f1d659d2f1043/6514887b27287d9b63bf9215/6O8d6cR.gif
md
{ "tags": [ "MongoDB", "Go" ], "pageDescription": "Learn how to build a web application with the Gin framework for Go and MongoDB using the help of Cody AI from Sourcegraph.", "contentType": "Tutorial" }
How to Build a Go Web Application with Gin, MongoDB, and with the Help of AI
2024-05-20T17:32:23.500Z
[ -0.02919306606054306, 0.014891638420522213, 0.024003518745303154, -0.010366319678723812, 0.034340303391218185, 0.019679617136716843, 0.004534272477030754, 0.022148190066218376, -0.006425179075449705, -0.03987327218055725, 0.020153438672423363, -0.07984752207994461, 0.03557003661990166, 0.021481378003954887, 0.03401476517319679, -0.008969014510512352, 0.02858051098883152, 0.030128860846161842, -0.06828644126653671, 0.029973909258842468, 0.042065102607011795, -0.017688877880573273, 0.011968957260251045, -0.06261353194713593, 0.017850900068879128, 0.018266336992383003, -0.026431016623973846, 0.018169403076171875, -0.0512949638068676, -0.20388732850551605, -0.016805818304419518, -0.06885775923728943, 0.0215840432792902, -0.04470757395029068, 0.009079605340957642, 0.001132023404352367, -0.04858735203742981, 0.07591479271650314, -0.037914570420980453, 0.04162999242544174, 0.06201663240790367, -0.03871379792690277, -0.056452661752700806, -0.04287063702940941, -0.045194294303655624, -0.045679762959480286, -0.019038839265704155, -0.006893707439303398, 0.03980876877903938, -0.054898928850889206, 0.01773803122341633, -0.00714337220415473, -0.02299053966999054, 0.037625476717948914, 0.03149256110191345, 0.030214207246899605, 0.08042202144861221, 0.03474663197994232, 0.024371357634663582, 0.06245889514684677, 0.051035452634096146, 0.07024747878313065, -0.2361963391304016, 0.07072935998439789, 0.05515708774328232, 0.01889982260763645, -0.02264106273651123, 0.009549415670335293, 0.0045720236375927925, 0.04499278590083122, -0.024150479584932327, 0.014225360937416553, 0.018365120515227318, 0.0012125027133151889, -0.00368077727034688, -0.03033491224050522, -0.03054335154592991, -0.01804289035499096, -0.03862651437520981, -0.03314908966422081, -0.015691474080085754, -0.00713067501783371, -0.029262149706482887, -0.04170047491788864, 0.005584999453276396, -0.0139138363301754, -0.041034944355487823, -0.08408717811107635, 0.06031617894768715, 0.03905804455280304, -0.017270788550376892, 0.018873590975999832, -0.01641327515244484, 0.022299831733107567, -0.06751429289579391, -0.02277984283864498, 0.0382830835878849, 0.0020371824502944946, -0.018861671909689903, 0.18759623169898987, -0.09743475168943405, 0.012571645900607109, 0.054831817746162415, -0.0025388384237885475, 0.026679985225200653, -0.042105693370103836, 0.0246381014585495, -0.03464309871196747, -0.021213581785559654, 0.04396617040038109, 0.008599402382969856, -0.018303584307432175, 0.05439724773168564, -0.04356800392270088, -0.01147772092372179, -0.015792688354849815, 0.0264086052775383, 0.0037134212907403708, -0.06085122004151344, -0.01807830110192299, 0.0018637290922924876, 0.022090451791882515, 0.05059918016195297, -0.004615918267518282, 0.053541313856840134, -0.0209494736045599, 0.046250611543655396, 0.1035943478345871, 0.04954581707715988, 0.049129996448755264, 0.06096998229622841, 0.005650962237268686, 0.021235521882772446, 0.00038332334952428937, -0.03547433763742447, 0.055392853915691376, -0.002348159672692418, -0.02509421855211258, 0.015184147283434868, -0.038513388484716415, -0.03227812051773071, -0.1660047322511673, 0.0002300692576682195, -0.07292313128709793, 0.002753707580268383, 0.08375652134418488, -0.019602742046117783, 0.013671185821294785, -0.09941598027944565, 0.024625636637210846, 0.010099070146679878, 0.05231977626681328, -0.010483268648386002, 0.019003067165613174, 0.02286216802895069, -0.0023973973002284765, 0.023751085624098778, 0.0948205217719078, -0.037655603140592575, -0.012347527779638767, -0.04617583751678467, -0.053703129291534424, -0.03287467360496521, 0.09429433196783066, 0.014825540594756603, -0.07659068703651428, -0.01936626061797142, 0.0035500070080161095, 0.0031280918046832085, -0.014051295816898346, -0.035811737179756165, 0.0453047975897789, -0.011140594258904457, 0.010749599896371365, 0.12822596728801727, 0.03729233890771866, -0.04312857985496521, 0.0022817670833319426, -0.004537666216492653, 0.03510164096951485, 0.021120810881257057, -0.016530461609363556, -0.04797549173235893, 0.08575443178415298, -0.0027616701554507017, -0.04737233370542526, 0.014870308339595795, -0.06531685590744019, 0.056773606687784195, 0.07228649407625198, -0.025742657482624054, 0.024751976132392883, -0.03762800246477127, 0.001247819629497826, -0.023601258173584938, -0.06176140159368515, -0.06009305641055107, -0.05979982763528824, -0.013376867398619652, -0.06757772713899612, 0.07071839272975922, -0.021182870492339134, -0.029983744025230408, 0.013607962056994438, -0.015728119760751724, 0.020859891548752785, 0.0065664444118738174, 0.02674398012459278, 0.04432165250182152, 0.04130443558096886, -0.038597024977207184, 0.043713293969631195, 0.0452660471200943, -0.009481185115873814, 0.030695900321006775, -0.028297720476984978, 0.021435169503092766, 0.033657874912023544, 0.008645419962704182, 0.012437052093446255, 0.01698445715010166, -0.10168249160051346, -0.0873488187789917, -0.21145211160182953, 0.013122878968715668, -0.012336893938481808, -0.04453004524111748, 0.01932387426495552, -0.009205636568367481, 0.032597631216049194, -0.008447212167084217, 0.011742508970201015, 0.05160682648420334, 0.08484537154436111, 0.003969341982156038, -0.02001626044511795, 0.009322678670287132, -0.008127065375447273, 0.022811194881796837, 0.01280348002910614, -0.011851497925817966, -0.026245130226016045, -0.04999646916985512, -0.03734796494245529, 0.012209617532789707, -0.013129988685250282, -0.057776596397161484, 0.022085603326559067, -0.027772756293416023, 0.2294415682554245, 0.06921476870775223, 0.020280882716178894, 0.008005868643522263, 0.029807059094309807, 0.03740732744336128, -0.01456894539296627, -0.07983092218637466, 0.03474609553813934, 0.04300471767783165, 0.013254609890282154, -0.010767391882836819, -0.02456337958574295, -0.02891598641872406, 0.021408233791589737, 0.027612296864390373, -0.03311237320303917, -0.05918176844716072, 0.01971183903515339, -0.01420168299227953, -0.0634632557630539, 0.026921287178993225, -0.004419267177581787, 0.01798040047287941, 0.010011093690991402, -0.0018675042083486915, 0.013499336317181587, 0.0061818999238312244, 0.01000671274960041, -0.0475320927798748, -0.04699453338980675, 0.009105457924306393, -0.003783311927691102, 0.0802759900689125, -0.03025732934474945, -0.05785047262907028, 0.007928348146378994, -0.06185884028673172, 0.05232994630932808, 0.02615148201584816, -0.012843419797718525, -0.028629690408706665, 0.023178352043032646, -0.03378387168049812, -0.037426967173814774, 0.11825218796730042, 0.01213036384433508, -0.019283633679151535, 0.07754000276327133, 0.00971443671733141, 0.019627567380666733, 0.0012882465962320566, 0.013797742314636707, -0.023449432104825974, 0.07660923898220062, -0.013705605641007423, -0.010209141299128532, 0.043771542608737946, 0.02214406244456768, 0.03149762377142906, 0.009272927418351173, -0.05026254430413246, 0.0525338388979435, -0.06612526625394821, 0.007592854555696249, 0.01122265588492155, -0.05872633308172226, -0.015484008006751537, 0.027029460296034813, 0.010388902388513088, -0.3457517623901367, 0.07371927052736282, 0.0363481268286705, 0.05002712830901146, 0.00607431773096323, 0.022623110562562943, 0.02217746153473854, 0.01874655857682228, -0.03149240463972092, 0.021197883412241936, 0.0035286475904285908, 0.0352962464094162, 0.028323138132691383, -0.05543994531035423, -0.007396577391773462, 0.03193245083093643, 0.005865868646651506, -0.038617782294750214, 0.04799540340900421, -0.051931414753198624, 0.0053122639656066895, 0.019600048661231995, 0.22388732433319092, -0.01763082481920719, -0.034049004316329956, 0.023821301758289337, -0.023236770182847977, 0.00656083831563592, 0.037686288356781006, 0.01668570749461651, 0.010003602132201195, -0.00742129934951663, 0.04012595862150192, -0.0035069521982222795, 0.011264042928814888, 0.06811162829399109, -0.06749680638313293, 0.01288024615496397, 0.020674534142017365, -0.05250310152769089, -0.03203626722097397, -0.007113514002412558, -0.04994233325123787, -0.03814937546849251, 0.09483099728822708, -0.007076173555105925, -0.002866764785721898, -0.0510304793715477, 0.017769718542695045, -0.008137566968798637, -0.037788040935993195, 0.014741014689207077, -0.026316195726394653, 0.0006710106390528381, 0.04159305989742279, 0.024093935266137123, -0.038187284022569656, -0.004565410315990448, -0.03467705845832825, 0.034396179020404816, 0.01784862019121647, -0.04337848722934723, 0.00681235222145915, 0.02483251877129078, 0.030078481882810593 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/build-go-web-application-gin-mongodb-help-ai
created
[7]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltd6759b52be548308/651482b2d45f2927c800b583/image3.png [8]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltfc8ea470eb6585bd/651482da69060a5af7fc2c40/image5.png [9]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blte5d9fb517f22f08f/651488d82a06d70de3f4faf9/Y2HuNHe.gif
md
{ "tags": [ "MongoDB", "Go" ], "pageDescription": "Learn how to build a web application with the Gin framework for Go and MongoDB using the help of Cody AI from Sourcegraph.", "contentType": "Tutorial" }
How to Build a Go Web Application with Gin, MongoDB, and with the Help of AI
2024-05-20T17:32:23.500Z
[ -0.044189319014549255, -0.010568817146122456, 0.033681418746709824, -0.014799040742218494, 0.038115814328193665, 0.018738053739070892, -0.007383090443909168, 0.026860078796744347, 0.004617145750671625, -0.034826673567295074, 0.017833849415183067, -0.09220899641513824, 0.04585318639874458, 0.026278765872120857, 0.05490667000412941, -0.013021931983530521, 0.03127165511250496, 0.037373099476099014, -0.07512369006872177, 0.012882116250693798, 0.04071847349405289, -0.008042133413255215, 0.009038480930030346, -0.07202509790658951, 0.005716993939131498, 0.02145690657198429, -0.02434258721768856, 0.003404933726415038, -0.03680763393640518, -0.19343923032283783, -0.011453649960458279, -0.044828861951828, 0.044442880898714066, -0.053860172629356384, 0.008716068230569363, 0.004277596715837717, -0.033803727477788925, 0.07183387875556946, -0.028841698542237282, 0.04259004443883896, 0.06758489459753036, -0.029165659099817276, -0.06707468628883362, -0.04027191177010536, -0.02615358494222164, -0.036185771226882935, -0.01225509587675333, -0.0039262427017092705, 0.025763142853975296, -0.04369378834962845, -0.013690130785107613, -0.01656496897339821, 0.0027872698847204447, 0.024403421208262444, -0.0006177839240990579, 0.022714821621775627, 0.05966385826468468, 0.016591787338256836, 0.026295488700270653, 0.05248456075787544, 0.0590466633439064, 0.014895826578140259, -0.23321859538555145, 0.05667606368660927, 0.05128573253750801, 0.018535928800702095, -0.038364067673683167, -0.0071829333901405334, -0.0013176953652873635, 0.05995898321270943, -0.01647930219769478, 0.030189692974090576, 0.0011126744793727994, 0.03201207518577576, 0.007323143072426319, -0.05212840437889099, -0.026506662368774414, 0.005291192792356014, -0.05048784241080284, -0.023160289973020554, 0.0045451754704117775, -0.013840108178555965, -0.02829405479133129, -0.013287069275975227, 0.0007149174925871193, -0.04227564483880997, -0.03794651851058006, -0.08329376578330994, 0.053886085748672485, 0.0202442929148674, -0.012296723201870918, 0.004907195456326008, -0.003184936009347439, 0.03345717117190361, -0.06792125850915909, -0.029416125267744064, 0.041072238236665726, -0.0134068438783288, -0.013800996355712414, 0.21419399976730347, -0.09147617220878601, 0.009683878161013126, 0.07412541657686234, 0.0028681783005595207, 0.050127800554037094, -0.05818084999918938, -0.0006823688163422048, -0.053891390562057495, -0.02967994660139084, 0.054786328226327896, 0.005714580416679382, -0.0218228530138731, 0.06308452785015106, -0.05475765839219093, 0.01753392070531845, -0.010471957735717297, 0.047214899212121964, -0.000625578744802624, -0.03922072425484657, -0.03170379623770714, -0.007764473557472229, 0.03960511088371277, 0.029406828805804253, -0.024065157398581505, 0.045148398727178574, -0.015059101395308971, 0.04684099182486534, 0.09710343182086945, 0.09083962440490723, 0.05805565416812897, 0.05750294402241707, -0.004479727707803249, 0.0012978065060451627, -0.02060687728226185, -0.012474683113396168, 0.04948437213897705, 0.0045168730430305, -0.03338417038321495, 0.01457605604082346, -0.024583177641034126, -0.04703923314809799, -0.15681029856204987, 0.02226259373128414, -0.08750305324792862, -0.011540570296347141, 0.07417619973421097, -0.02040778286755085, 0.0147430170327425, -0.09327740222215652, 0.018632154911756516, 0.01451120525598526, 0.029814353212714195, -0.03383403643965721, 0.00016355229308828712, 0.02101932279765606, 0.007921339944005013, 0.0519099235534668, 0.1003829762339592, -0.021408800035715103, -0.008884647861123085, -0.036979541182518005, -0.05995110422372818, -0.051741618663072586, 0.09218616783618927, 0.024940703064203262, -0.09010974317789078, -0.017990587279200554, -0.0030599418096244335, -0.0032185467425733805, -0.0035900406073778868, -0.03372383490204811, 0.0483672171831131, -0.01749405637383461, 0.04172296077013016, 0.13134008646011353, 0.008790814317762852, -0.032260701060295105, -0.006815661210566759, -0.0035495099145919085, 0.014816202223300934, 0.004850167781114578, -0.027031969279050827, -0.037757664918899536, 0.08030050992965698, 0.013668511994183064, -0.05213802307844162, 0.016045503318309784, -0.03416247293353081, 0.06273902207612991, 0.0723641961812973, -0.017808297649025917, 0.023479336872696877, -0.039475344121456146, 0.013901467435061932, -0.020852934569120407, -0.07071436941623688, -0.04352729767560959, -0.03831026703119278, -0.004955199081450701, -0.05427874997258186, 0.08146889507770538, -0.019124241545796394, -0.03416084870696068, 0.016763310879468918, -0.04088381305336952, 0.019594959914684296, -0.002632299903780222, -0.0012376134982332587, 0.04443056136369705, 0.04316829890012741, -0.027427252382040024, 0.04086962714791298, 0.04494072496891022, -0.00464720418676734, 0.025970393791794777, -0.029376588761806488, 0.012239175848662853, 0.02834651805460453, 0.002676475327461958, 0.00718813668936491, 0.019266841933131218, -0.10836991667747498, -0.08215780556201935, -0.2176017016172409, -0.020771220326423645, -0.0029576392844319344, -0.06035158410668373, 0.012360654771327972, -0.02459026128053665, 0.00801130197942257, -0.013255770318210125, 0.012464425526559353, 0.04895249754190445, 0.08212131261825562, 0.0030808872543275356, -0.047618620097637177, 0.004963661078363657, -0.028577810153365135, 0.003242750884965062, 0.004421069752424955, -0.001535124029032886, -0.03860325738787651, -0.01943065971136093, -0.04708646610379219, 0.022239699959754944, -0.01508521381765604, -0.07608501613140106, 0.024229679256677628, -0.022259831428527832, 0.23312735557556152, 0.08304804563522339, 0.020676366984844208, 0.008932717144489288, 0.022735798731446266, 0.043757811188697815, -0.03210960701107979, -0.10503660887479782, 0.04754355549812317, 0.03314041718840599, 0.013773600570857525, -0.016047140583395958, -0.004126391839236021, -0.029625078663229942, 0.00027645353111438453, 0.03761991113424301, -0.01711151748895645, -0.04715673625469208, 0.028357677161693573, -0.02759670652449131, -0.04121944308280945, 0.013956938870251179, -0.004582803230732679, 0.031272489577531815, 0.01569284312427044, 0.012235394679009914, 0.020021023228764534, -0.0007164052804000676, 0.009001166559755802, -0.02194887585937977, -0.03862685710191727, -0.002519488101825118, -0.027732808142900467, 0.0930318608880043, -0.002672712318599224, -0.05428022891283035, -0.02104087732732296, -0.08221889287233353, 0.05645855516195297, 0.024075716733932495, -0.003994629252701998, -0.04421309381723404, 0.034832920879125595, -0.039225704967975616, -0.041741084307432175, 0.1211949810385704, 0.016240937635302544, -0.00852609146386385, 0.06666438281536102, 0.03310674428939819, 0.017887774854898453, -0.0034784842282533646, 0.02197222225368023, -0.019316449761390686, 0.05505162477493286, -0.02545834891498089, 0.0003452915698289871, 0.061753008514642715, 0.027255216613411903, 0.03225861117243767, 0.029448701068758965, -0.03340998291969299, 0.07391484826803207, -0.05249611288309097, -0.010289886966347694, -0.01042162161320448, -0.04269999638199806, -0.022087641060352325, 0.022529765963554382, 0.013522638939321041, -0.3295029401779175, 0.07910921424627304, 0.03632991388440132, 0.04053899645805359, 0.017308568581938744, 0.028465628623962402, 0.030763136222958565, 0.028409969061613083, -0.053839102387428284, 0.009657536633312702, 0.011105849407613277, 0.06403867900371552, 0.024326957762241364, -0.019279304891824722, 0.0056002517230808735, 0.008424467407166958, 0.021907657384872437, -0.017070498317480087, 0.0453338660299778, -0.03215673193335533, 0.017374731600284576, 0.011714117601513863, 0.21234217286109924, -0.03705383464694023, -0.02900511957705021, 0.008696691133081913, -0.029192015528678894, 0.006021527107805014, 0.04173163324594498, -0.00020941034017596394, 0.02481204830110073, 0.006639786064624786, 0.05480317398905754, -0.027663005515933037, -0.0017459802329540253, 0.049943383783102036, -0.07228302210569382, 0.013872809708118439, -0.00006754952482879162, -0.035771068185567856, -0.025125309824943542, 0.018127724528312683, -0.05137636139988899, -0.03641371428966522, 0.07907884567975998, -0.022726010531187057, -0.006124057807028294, -0.035957012325525284, 0.03463170304894447, 0.0074511943385005, -0.06039900332689285, 0.00664732838049531, -0.024045545607805252, 0.0016220586840063334, 0.035155586898326874, 0.029706763103604317, -0.012035802006721497, -0.012826168909668922, -0.028539620339870453, 0.019587215036153793, 0.024660198017954826, -0.03263578563928604, 0.0008561147842556238, 0.019984567537903786, 0.03606494888663292 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/build-go-web-application-gin-mongodb-help-ai
created
[10]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltc2467265b39e7d2b/651483038f0457d9df12aceb/image6.png [11]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt972b959f5918c282/651483244f2fa81286699c09/image1.png [12]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt9c888329868b60b6/6514892c2a06d7d0a6f4fafd/g4xtxUg.gif
md
{ "tags": [ "MongoDB", "Go" ], "pageDescription": "Learn how to build a web application with the Gin framework for Go and MongoDB using the help of Cody AI from Sourcegraph.", "contentType": "Tutorial" }
How to Build a Go Web Application with Gin, MongoDB, and with the Help of AI
2024-05-20T17:32:23.500Z
[ -0.03999573737382889, -0.0005060909898020327, 0.028289152309298515, -0.03453768044710159, 0.043509144335985184, 0.013511709868907928, -0.009030942805111408, 0.027238896116614342, 0.0036280725616961718, -0.026429366320371628, 0.014726255089044571, -0.07695293426513672, 0.04984772205352783, 0.02015429362654686, 0.05538884177803993, -0.004708609078079462, 0.027643270790576935, 0.020023060962557793, -0.0756821557879448, 0.025042898952960968, 0.05347231775522232, -0.015881812199950218, 0.021381283178925514, -0.05080398917198181, 0.0052389297634363174, 0.011074759997427464, -0.014534881338477135, 0.011851547285914421, -0.04344853758811951, -0.1893828958272934, -0.011170562356710434, -0.059959668666124344, 0.04026640206575394, -0.030356738716363907, 0.010836072266101837, -0.03052332065999508, -0.0323798693716526, 0.08248034119606018, -0.04470771178603172, 0.049112480133771896, 0.05839026719331741, -0.026630433276295662, -0.05594737082719803, -0.06400046497583389, -0.02936604991555214, -0.04148728400468826, -0.03399856761097908, -0.01484969723969698, 0.01974232867360115, -0.05284247174859047, 0.013200405053794384, -0.018796255812048912, 0.0020046206191182137, 0.051472365856170654, 0.023965628817677498, 0.03555414825677872, 0.07372164726257324, 0.03981561213731766, 0.0525716170668602, 0.04460916668176651, 0.030617445707321167, 0.04306545853614807, -0.2281389832496643, 0.07905831933021545, 0.07559189200401306, 0.02691943570971489, -0.02452806569635868, 0.009620173834264278, 0.01020586583763361, 0.04923288896679878, -0.01688542775809765, 0.00586414011195302, 0.015828628093004227, 0.020122118294239044, 0.008335445076227188, -0.05250716209411621, -0.02163209393620491, 0.0025693585630506277, -0.03836637735366821, -0.03328704088926315, -0.0003567413950804621, -0.009523281827569008, -0.007864338345825672, -0.027316244319081306, 0.010802573524415493, -0.021093735471367836, -0.027831625193357468, -0.07699979841709137, 0.029048390686511993, 0.01091510709375143, -0.010724642314016819, -0.003999331500381231, -0.014651142060756683, 0.023009466007351875, -0.06461354345083237, -0.02341374009847641, 0.019072480499744415, -0.0027183620259165764, -0.026434151455760002, 0.22739587724208832, -0.08334570378065109, 0.009830871596932411, 0.0717354565858841, -0.0071472423151135445, 0.04058802127838135, -0.06799530237913132, -0.00008197146962629631, -0.04317571222782135, -0.03939677029848099, 0.01932220533490181, 0.025115439668297768, -0.012294509448111057, 0.07165355235338211, -0.02132248878479004, 0.009736442007124424, -0.02280569076538086, 0.02433153986930847, -0.007021037861704826, -0.04056914150714874, -0.024183709174394608, -0.02980400249361992, 0.023183617740869522, 0.03755912184715271, -0.027386128902435303, 0.044723570346832275, -0.030752534046769142, 0.0575697086751461, 0.0928388237953186, 0.040330931544303894, 0.05298026651144028, 0.06326232105493546, -0.006448864936828613, 0.010020023211836815, -0.002011982724070549, -0.04314139857888222, 0.04674013704061508, -0.0176608394831419, -0.023001130670309067, 0.0057541080750525, -0.033373259007930756, -0.033748578280210495, -0.15522530674934387, -0.0022634549532085657, -0.07974212616682053, 0.0015784091083332896, 0.09194421768188477, -0.015881488099694252, 0.005734801292419434, -0.08493281155824661, 0.02250184677541256, 0.004436047747731209, 0.0404537059366703, -0.013550777919590473, 0.018047701567411423, 0.017336156219244003, 0.012875702232122421, 0.045253630727529526, 0.08985122293233871, -0.043083518743515015, -0.014989443123340607, -0.01856081187725067, -0.06975449621677399, -0.05549970641732216, 0.10282786190509796, 0.01393216848373413, -0.08694960922002792, -0.0016686419257894158, -0.01196206547319889, -0.018559575080871582, -0.01446126215159893, -0.03263923525810242, 0.013194480910897255, -0.017404373735189438, 0.022606724873185158, 0.11843983829021454, 0.034596998244524, -0.043310437351465225, -0.015580165199935436, -0.005566706415265799, 0.015620351769030094, 0.015756923705339432, -0.02738187648355961, -0.04590727388858795, 0.08685540407896042, 0.015879450365900993, -0.0572001188993454, 0.01686861924827099, -0.06051082909107208, 0.046166520565748215, 0.056347526609897614, -0.024978630244731903, 0.012233138084411621, -0.029566844925284386, 0.027616092935204506, -0.033933039754629135, -0.054595671594142914, -0.025237541645765305, -0.03753893822431564, -0.014669463969767094, -0.05414554476737976, 0.09497407078742981, -0.018662745133042336, -0.047617409378290176, 0.00559161277487874, -0.04113765433430672, 0.03356285020709038, 0.006621244829148054, 0.027797477319836617, 0.04994277283549309, 0.03528494015336037, -0.025739217177033424, 0.039349403232336044, 0.027309095486998558, 0.008954834192991257, 0.026452921330928802, -0.01565771922469139, 0.0069666048511862755, 0.04409407824277878, 0.0010844714706763625, 0.005827724933624268, 0.008393162861466408, -0.1072729080915451, -0.06724940985441208, -0.2112101912498474, 0.00010757438576547429, 0.0057016597129404545, -0.051396001130342484, 0.02340082637965679, -0.02753205969929695, 0.020428799092769623, 0.014120234176516533, 0.008055128157138824, 0.045355528593063354, 0.09017108380794525, 0.007280808407813311, -0.021547917276620865, 0.013829473406076431, -0.0189697053283453, 0.01996559463441372, 0.002760845236480236, 0.007237215992063284, -0.01964835822582245, -0.046715255826711655, -0.03791579231619835, -0.004454667679965496, 0.005473795812577009, -0.06901188939809799, 0.03937451168894768, -0.03787563741207123, 0.2419455647468567, 0.08723001182079315, 0.0026173593942075968, 0.0008094750810414553, 0.03813454508781433, 0.049749571830034256, -0.02540922351181507, -0.08058234304189682, 0.04585042595863342, 0.033775050193071365, 0.00029076318605802953, -0.022634824737906456, 0.006228514481335878, -0.030405759811401367, -0.009833406656980515, 0.05146070569753647, -0.02817184291779995, -0.06090451776981354, 0.021007779985666275, -0.015471654944121838, -0.04468134790658951, 0.01640845276415348, -0.01072132308036089, 0.049397069960832596, 0.01085043977946043, 0.01650083251297474, 0.02144641801714897, 0.01376933790743351, -0.01048666425049305, -0.043893128633499146, -0.05716850236058235, -0.0009097238653339446, 0.014097016304731369, 0.06305520236492157, -0.014662989415228367, -0.05477985739707947, -0.019749438390135765, -0.07516675442457199, 0.04015405848622322, 0.02433769963681698, -0.016555190086364746, -0.03930746763944626, 0.06185095012187958, -0.03803502395749092, -0.011400500312447548, 0.11110624670982361, 0.014930599369108677, -0.021903133019804955, 0.06331446021795273, 0.03269818797707558, 0.00593609968200326, 0.0016035402659326792, 0.007983824238181114, -0.02733468823134899, 0.05559635907411575, -0.010820225812494755, -0.008581719361245632, 0.04596903175115585, 0.022705290466547012, 0.02258671075105667, 0.01904863864183426, -0.03748762607574463, 0.04964534565806389, -0.05544153228402138, 0.00019060110207647085, 0.0006371439667418599, -0.040296293795108795, -0.01586645469069481, 0.01696459762752056, 0.01698806881904602, -0.3482059836387634, 0.10360044240951538, 0.035255905240774155, 0.0367375910282135, 0.008291737176477909, 0.03257280960679054, 0.04392590746283531, 0.018710628151893616, -0.02563474141061306, 0.0009672603919170797, 0.009903617203235626, 0.034085046499967575, 0.03983752429485321, -0.03180747479200363, -0.022460760548710823, 0.029054393991827965, 0.00628437427803874, -0.013506833463907242, 0.0561366081237793, -0.017845042049884796, 0.021857047453522682, 0.007848620414733887, 0.219970241189003, -0.019291387870907784, -0.024263156577944756, 0.02403140440583229, -0.029619615525007248, -0.017875980585813522, 0.05439256131649017, 0.004690706264227629, 0.011197109706699848, -0.001143644331023097, 0.048335108906030655, -0.024261489510536194, 0.026158617809414864, 0.06124920770525932, -0.08125735819339752, 0.044643450528383255, -0.022182023152709007, -0.06450439244508743, -0.019979404285550117, 0.01672627590596676, -0.046990107744932175, -0.013053099624812603, 0.07543577253818512, -0.016667883843183517, -0.013024546205997467, -0.04323205351829529, 0.021708061918616295, -0.006356651894748211, -0.04310458526015282, 0.003788379253819585, -0.013854783959686756, -0.007469265256077051, 0.02781539037823677, -0.010707898996770382, -0.004770997446030378, -0.03760748729109764, -0.04113561287522316, 0.004311542958021164, 0.03341744467616081, -0.04807049781084061, 0.013195019215345383, 0.00936892069876194, 0.0343012660741806 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
# Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas In today’s data-centric world, time-series data has become indispensable for driving key organizational decisions, trend analyses, and forecasts. This kind of data is everywhere — from stock markets and IoT sensors to user behavior analytics. But as these datasets grow in volume and complexity, so does the challenge of efficiently storing and analyzing them. Whether you’re an IoT developer or a data analyst dealing with time-sensitive information, MongoDB offers a robust ecosystem tailored to meet both your storage and analytics needs for complex time-series data.
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.02833707258105278, 0.0024371319450438023, 0.02177046239376068, -0.04160935431718826, 0.07728856801986694, -0.02501668781042099, 0.011450113728642464, 0.015000634826719761, 0.019216835498809814, 0.022285381332039833, -0.007820398546755314, -0.06186875328421593, 0.019022731110453606, 0.02063073217868805, -0.0029469747096300125, -0.006700383499264717, -0.01784657873213291, 0.011010394431650639, -0.05583612248301506, 0.014958149753510952, -0.001966553507372737, -0.030706577003002167, -0.0668247789144516, -0.05525597929954529, 0.03891480714082718, 0.07119492441415787, 0.01148348767310381, -0.020087575539946556, -0.05793824791908264, -0.19426003098487854, -0.0008259637397713959, -0.074854776263237, 0.05493156611919403, -0.059220924973487854, 0.026443522423505783, -0.016877489164471626, -0.004525362513959408, 0.055768463760614395, 0.0016614024061709642, 0.05790378525853157, 0.03550180792808533, 0.009339746087789536, -0.06576334685087204, -0.04865574091672897, -0.04772733896970749, -0.06621731072664261, -0.0071105449460446835, -0.018341373652219772, -0.011543703265488148, -0.029764873906970024, -0.01571507379412651, 0.0009148127865046263, 0.014339408837258816, 0.038660019636154175, 0.03204383701086044, 0.033564310520887375, 0.05953935161232948, 0.0167374424636364, 0.045478664338588715, -0.015106171369552612, 0.07704814523458481, 0.012234952300786972, -0.1619710922241211, 0.0919916182756424, 0.03699728474020958, 0.051164887845516205, -0.026061836630105972, -0.02746823988854885, 0.023826375603675842, 0.03324470296502113, -0.031832702457904816, -0.007052071858197451, 0.00717127462849021, 0.025334874168038368, 0.014161771163344383, -0.0142590356990695, -0.012108382768929005, -0.07991895079612732, -0.00920686312019825, 0.028190959244966507, -0.015570544637739658, -0.024574963375926018, -0.049041714519262314, -0.005674503277987242, -0.0013946479884907603, -0.0336245596408844, 0.030161406844854355, -0.021052686497569084, 0.015439282171428204, -0.0013361942255869508, -0.005010625347495079, -0.018940096721053123, 0.01251723151654005, 0.034581977874040604, -0.05876942351460457, -0.006739969830960035, 0.04343361034989357, 0.041689854115247726, -0.008244019001722336, 0.2454778254032135, -0.07022112607955933, 0.05207999795675278, -0.0028447378426790237, -0.021530164405703545, 0.037453196942806244, -0.0575069859623909, 0.0037498734891414642, -0.06545525044202805, 0.00560810137540102, -0.0014017005451023579, -0.01894325390458107, -0.033509209752082825, 0.03517761453986168, -0.07582477480173111, 0.04758501052856445, -0.005247344728559256, -0.009968627244234085, 0.03206828609108925, -0.018518339842557907, 0.03819112107157707, -0.00760659808292985, 0.01598397269845009, 0.07230742275714874, -0.023474832996726036, 0.03608904778957367, -0.0312897153198719, 0.0475815124809742, 0.11714478582143784, 0.004802516661584377, 0.005886245518922806, 0.004585259594023228, -0.000028673202905338258, -0.09643552452325821, -0.0008890395401977003, 0.017331143841147423, 0.018164772540330887, -0.015957798808813095, 0.015583496540784836, 0.04665910080075264, 0.00769841717556119, -0.042029377073049545, -0.07141461968421936, 0.004004199989140034, -0.07361948490142822, -0.04320608079433441, 0.14970162510871887, -0.0020497574005275965, 0.06600818037986755, -0.0685701072216034, -0.016834374517202377, -0.04331013932824135, 0.026624802500009537, -0.03335314616560936, -0.048743002116680145, 0.01992279849946499, 0.02587032876908779, 0.054519202560186386, 0.03329453989863396, -0.017653245478868484, -0.02938184142112732, -0.06433188915252686, -0.006467354018241167, -0.03239191323518753, 0.08227792382240295, -0.01340777799487114, -0.14265570044517517, 0.010599813424050808, 0.02357499860227108, 0.016270611435174942, -0.02011049911379814, 0.029634440317749977, 0.038931846618652344, -0.04291464760899544, 0.032737262547016144, 0.09229110926389694, 0.004686403088271618, -0.03219706937670708, -0.007521589286625385, 0.03328600898385048, 0.005434707272797823, 0.016951940953731537, -0.0351327508687973, -0.020157774910330772, 0.014638260938227177, 0.007241751998662949, -0.046859439462423325, 0.0155403520911932, -0.003310111351311207, 0.0194709412753582, 0.03953943029046059, 0.02404954470694065, -0.029470164328813553, -0.023591842502355576, 0.017918365076184273, -0.024469750002026558, -0.04021361842751503, -0.02115355245769024, -0.015253787860274315, 0.015979189425706863, -0.06503346562385559, 0.01631319150328636, -0.013068296946585178, -0.013382906094193459, 0.03339904919266701, 0.03412289917469025, 0.011759699322283268, -0.03665114939212799, 0.014676080085337162, 0.059972263872623444, -0.01596938446164131, 0.010167059488594532, 0.0018548705847933888, 0.020106669515371323, -0.027239743620157242, -0.029725592583417892, -0.007833709008991718, 0.012245717458426952, 0.021846259012818336, 0.02503589540719986, 0.04790779575705528, 0.01561846025288105, -0.0640719011425972, -0.053003814071416855, -0.26336216926574707, -0.006622788496315479, 0.004204621538519859, 0.03530076518654823, 0.04195405915379524, -0.06617379933595657, -0.0031912524718791246, -0.029004331678152084, 0.009449528530240059, 0.08240590989589691, 0.06503334641456604, -0.0020925661083310843, 0.00015655794413760304, 0.008364634588360786, -0.024441378191113472, 0.07668855041265488, 0.014335475862026215, 0.03007403016090393, -0.06382203102111816, 0.015985114499926567, -0.014070108532905579, 0.002005906542763114, -0.025113916024565697, -0.09014753252267838, 0.02457130141556263, 0.011140862479805946, 0.19166108965873718, 0.021646711975336075, 0.007941587828099728, -0.045101817697286606, 0.022886032238602638, -0.04235294088721275, -0.03956977277994156, -0.08737996220588684, 0.05121041461825371, 0.02804265357553959, 0.04884633421897888, 0.014951161108911037, -0.05110609903931618, -0.03140764683485031, -0.045160695910453796, 0.04271295666694641, 0.055329617112874985, -0.04111986234784126, -0.029987996444106102, -0.021708214655518532, -0.008476653136312962, -0.007783643435686827, -0.053771957755088806, 0.004154140129685402, 0.02045382186770439, 0.006227754056453705, 0.0787816196680069, 0.013676841743290424, -0.021225837990641594, -0.04398728534579277, -0.07159506529569626, 0.04436764121055603, -0.030964992940425873, 0.030703961849212646, -0.022000405937433243, -0.06419261544942856, 0.030934423208236694, -0.008037857711315155, 0.03149416297674179, -0.0187528133392334, -0.019145946949720383, -0.02506713755428791, -0.002676629461348057, -0.023929370567202568, -0.014135654084384441, 0.12928570806980133, -0.0449051596224308, 0.0037104496732354164, 0.04434756562113762, 0.03181862086057663, 0.030228272080421448, 0.009093605913221836, -0.0470685213804245, -0.022205762565135956, 0.07751625776290894, -0.01096698734909296, 0.017670145258307457, 0.06283444166183472, 0.05364499241113663, -0.00490142684429884, 0.08861200511455536, -0.03004010207951069, 0.022475047037005424, -0.040429502725601196, -0.014324083924293518, -0.021499883383512497, -0.05608554929494858, -0.025539740920066833, 0.012879679910838604, 0.04305288940668106, -0.2943277657032013, 0.054422777146101, -0.043118786066770554, 0.00562465563416481, 0.014496255666017532, -0.0008133189403451979, 0.005904556717723608, 0.04386455565690994, -0.032176218926906586, 0.013104738667607307, 0.0017986655002459884, 0.03601939603686333, 0.04951372742652893, -0.01940285414457321, -0.005711541511118412, 0.03709438443183899, 0.06819664686918259, -0.05937543883919716, 0.021934909746050835, 0.004272923804819584, 0.058879271149635315, 0.04304821044206619, 0.2565692365169525, -0.0037878339644521475, 0.04002999886870384, 0.016211235895752907, 0.0135263130068779, 0.004381445236504078, 0.04922662675380707, -0.004376755096018314, 0.008070381358265877, -0.014829709194600582, 0.07161139696836472, -0.027308395132422447, 0.017481617629528046, 0.07345986366271973, -0.03941500931978226, 0.040749747306108475, 0.02762714959681034, -0.04962284862995148, 0.004867944400757551, 0.010847492143511772, -0.02048845961689949, -0.025023765861988068, 0.12448279559612274, -0.035318050533533096, -0.04102663695812225, -0.10255145281553268, 0.023840168491005898, 0.04767727106809616, -0.07199452817440033, -0.026936760172247887, -0.041787102818489075, 0.03176523745059967, 0.018572567030787468, 0.054049424827098846, 0.007217273116111755, 0.012303497642278671, 0.012940185144543648, -0.06740830838680267, 0.01792319305241108, -0.10546953976154327, -0.013821110129356384, 0.0055364761501550674, 0.005318940617144108 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
MongoDB has built-in support to store time-series data in a special type of collection called a time-series collection. Time-series collections are different from the normal collections. Time-series collections use an underlying columnar storage format and store data in time-order with an automatically created clustered index. The columnar storage format provides the following benefits: * Reduced complexity: The columnar format is tailored for time-series data, making it easier to manage and query. * Query efficiency: MongoDB automatically creates an internal clustered index on the time field which improves query performance. * Disk usage: This storage approach uses disk space more efficiently compared to traditional collections. * I/O optimization: The read operations require fewer input/output operations, improving the overall system performance. * Cache usage: The design allows for better utilization of the WiredTiger cache, further enhancing query performance.
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.027096791192889214, 0.023273304104804993, 0.030341608449816704, -0.0043558645993471146, 0.06963969767093658, -0.0035120437387377024, -0.005248436238616705, 0.01133462693542242, 0.007697366643697023, -0.0037319192197173834, -0.011030576191842556, -0.03577454388141632, 0.03645750507712364, 0.0467967614531517, -0.02764912135899067, -0.006028277333825827, -0.022988513112068176, -0.006424985826015472, -0.035342488437891006, 0.012256846763193607, 0.044157981872558594, -0.02959834784269333, -0.021506808698177338, -0.03315013647079468, 0.02603711001574993, 0.06520124524831772, -0.02309349738061428, -0.028629068285226822, -0.060495760291814804, -0.2172297090291977, 0.01575082167983055, -0.07067795097827911, 0.07096723467111588, -0.03420355170965195, -0.015347831882536411, -0.03644159808754921, 0.01113788690418005, 0.07781583070755005, -0.05048434063792229, 0.04842117801308632, 0.03430260717868805, 0.022471146658062935, -0.02904377691447735, -0.04816778376698494, -0.053459882736206055, -0.07662423700094223, -0.021040165796875954, -0.022177670150995255, -0.0010977959027513862, -0.022638114169239998, -0.0434555858373642, 0.01535982545465231, -0.025414012372493744, 0.020645959302783012, 0.018328363075852394, 0.06257420033216476, 0.06384769082069397, 0.00027943728491663933, 0.007683258503675461, -0.01238124631345272, 0.09777761995792389, 0.004102672915905714, -0.16290296614170074, 0.08033474534749985, 0.004438498988747597, 0.023472938686609268, -0.0018112232210114598, -0.023109883069992065, 0.014830627478659153, -0.0006459122523665428, -0.05613844841718674, 0.007553157862275839, 0.03142167627811432, 0.013515138998627663, 0.018813418224453926, 0.004734949208796024, -0.007320064585655928, -0.06825363636016846, -0.02172849327325821, 0.05304368585348129, -0.033050861209630966, -0.040592093020677567, -0.006344796624034643, -0.018506238237023354, -0.01625235006213188, -0.05830775201320648, 0.02523842640221119, -0.08876731246709824, 0.02922855317592621, 0.006171786226332188, -0.01358141377568245, -0.008603121154010296, 0.035949867218732834, 0.04236496984958649, -0.06697793304920197, -0.01662343181669712, 0.04292731732130051, 0.0808546394109726, -0.009142368100583553, 0.23591631650924683, -0.022022444754838943, 0.055019162595272064, 0.022687813267111778, -0.032358963042497635, 0.004897402133792639, -0.07526960223913193, 0.0525440014898777, -0.05656794086098671, -0.032072022557258606, -0.003380236914381385, 0.007335143629461527, -0.016204791143536568, 0.01549929566681385, -0.06998151540756226, 0.028709592297673225, -0.0058294739574193954, -0.015081994235515594, 0.02841527946293354, -0.011339348740875721, 0.023926256224513054, -0.0025336695834994316, 0.06372207403182983, 0.06350035965442657, 0.003086068434640765, 0.036055441945791245, -0.04311825707554817, 0.08406905084848404, 0.0990011915564537, -0.008798373863101006, 0.02534286119043827, 0.0034165107645094395, -0.0192718468606472, -0.08271295577287674, 0.0000695801863912493, 0.01877366565167904, 0.00288576097227633, 0.004136255942285061, 0.0016202263068407774, 0.03023688495159149, -0.007036289665848017, -0.02177061326801777, -0.05211895704269409, 0.023192251101136208, -0.061857786029577255, -0.0457773357629776, 0.1425594836473465, 0.009399675764143467, 0.06407710164785385, -0.07665472477674484, -0.012036851607263088, -0.02404814213514328, 0.04485968127846718, -0.02916358783841133, -0.0647222027182579, -0.0027684129308909178, 0.01314782164990902, 0.025071922689676285, 0.03237129747867584, -0.033939607441425323, -0.015397489070892334, -0.06686122715473175, 0.015028017573058605, -0.012295471504330635, 0.08464633673429489, -0.0041386825032532215, -0.1281253546476364, -0.01956600695848465, 0.032931435853242874, 0.011116806417703629, -0.037415970116853714, 0.04692400246858597, -0.005995194893330336, -0.025422027334570885, 0.03633541986346245, 0.1043989360332489, 0.010084390640258789, -0.05751902982592583, -0.021934056654572487, -0.009735653176903725, -0.04167661443352699, 0.027530908584594727, -0.001869117608293891, -0.019654372707009315, 0.05304226651787758, 0.014939587563276291, -0.016094882041215897, -0.021219830960035324, 0.0051377685740590096, 0.03848715499043465, 0.03935614600777626, 0.009201708249747753, -0.01393158920109272, -0.029203398153185844, 0.057023048400878906, -0.03024955652654171, -0.05672059208154678, 0.001855528331361711, -0.009221352636814117, 0.011238990351557732, -0.05256783589720726, 0.04565788432955742, -0.006264990195631981, -0.010145439766347408, 0.05236135795712471, 0.040806952863931656, -0.0004368024237919599, -0.0523664690554142, -0.0408564954996109, 0.01662589982151985, -0.021903928369283676, -0.03697547689080238, -0.004201702307909727, 0.023569341748952866, 0.00548487389460206, -0.0625123679637909, -0.010870398953557014, 0.04299012944102287, -0.002141734817996621, 0.038240354508161545, 0.04781324043869972, 0.03008238784968853, -0.07209545373916626, -0.04639023169875145, -0.23203282058238983, 0.008928027004003525, -0.02713576890528202, 0.0267904382199049, 0.07470017671585083, -0.06138046830892563, -0.002672959119081497, -0.016086941584944725, 0.01348528265953064, 0.028420424088835716, 0.008606980554759502, -0.04828130826354027, -0.01630055345594883, 0.018185071647167206, -0.04632788896560669, 0.07151550054550171, 0.019947508350014687, 0.012225184589624405, -0.05585669353604317, 0.014956805855035782, 0.006629146169871092, 0.02355976030230522, -0.02354205772280693, -0.07734932750463486, 0.046529803425073624, 0.03447016701102257, 0.17471493780612946, 0.0011500522959977388, 0.0036647063679993153, -0.05681750178337097, 0.0708400160074234, -0.027038145810365677, -0.028788071125745773, -0.07840289175510406, 0.04569396376609802, 0.023270292207598686, 0.02982797659933567, 0.013293961994349957, -0.01892818883061409, -0.03521883860230446, -0.06071680411696434, 0.05058244615793228, 0.04053719714283943, -0.05324086919426918, -0.03317226469516754, -0.014214478433132172, -0.012675123289227486, 0.006632340606302023, -0.05764463543891907, 0.006890603341162205, -0.008009567856788635, -0.03628300130367279, 0.05359724909067154, 0.014401601627469063, 0.018913712352514267, -0.057148277759552, -0.06665629893541336, 0.005619130562990904, -0.03037290647625923, 0.04004015028476715, -0.009921531192958355, -0.018196167424321175, 0.04816538468003273, -0.03785441070795059, 0.016682811081409454, 0.0008774196612648666, -0.01460825651884079, 0.002299183513969183, -0.024102171882987022, -0.0331563726067543, -0.008177652023732662, 0.0582696795463562, -0.06142651289701462, 0.01716718077659607, 0.07084178179502487, 0.026247555390000343, 0.007465333212167025, 0.024419797584414482, -0.027214981615543365, -0.04116467759013176, 0.05854323133826256, -0.041639771312475204, 0.061970293521881104, 0.06374660134315491, 0.04903421550989151, 0.019442183896899223, 0.08742590248584747, 0.0000857497871038504, -0.001160294166766107, -0.010210205800831318, -0.009435715153813362, -0.019066421315073967, -0.08150029182434082, -0.06725163757801056, 0.013872237876057625, -0.0053764525800943375, -0.32755306363105774, 0.06524220108985901, -0.008674445562064648, -0.02508091926574707, -0.005351999308913946, 0.006851091980934143, -0.03054487518966198, 0.07395876944065094, 0.004263414070010185, 0.033884353935718536, -0.02451491169631481, 0.07293771952390671, 0.01816258579492569, -0.015505030751228333, -0.012822074815630913, 0.07995429635047913, 0.0573582723736763, -0.06331273913383484, 0.05882779508829117, -0.03812102973461151, 0.052751727402210236, 0.0346287377178669, 0.24507510662078857, 0.03185528516769409, 0.016573917120695114, 0.02400878258049488, 0.021841375157237053, 0.0037602486554533243, 0.03816865384578705, -0.005563396494835615, 0.030087100341916084, 0.005056306719779968, 0.09948369860649109, 0.013932689093053341, 0.027749063447117805, 0.07712820172309875, -0.025210000574588776, 0.05665278807282448, 0.011350398883223534, -0.012553072534501553, -0.042942341417074203, 0.035061076283454895, -0.03914845734834671, 0.0104563869535923, 0.09955667704343796, -0.06934109330177307, -0.051061421632766724, -0.09344321489334106, 0.02790926955640316, 0.03239822015166283, -0.04530588164925575, -0.03249261900782585, -0.01288861408829689, 0.01378445141017437, 0.027051053941249847, 0.020771298557519913, -0.013258137740194798, 0.021919334307312965, -0.015025570057332516, -0.04268122836947441, 0.013897332362830639, -0.047939881682395935, -0.01796824112534523, 0.005877190735191107, 0.0314493328332901 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
In this tutorial, we will create a time-series collection and then store some time-series data into it. We will see how you can query it in MongoDB as well as how you can read that data into pandas DataFrame, run some analytics on it, and write the modified data back to MongoDB. This tutorial is meant to be a complete deep dive into working with time-series data in MongoDB. ### Tutorial Prerequisites We will be using the following tools/frameworks: * MongoDB Atlas database, to store our time-series data. If you don’t already have an Atlas cluster created, go ahead and create one, set up a user, and add your connection IP address to your IP access list. * PyMongo driver(to connect to your MongoDB Atlas database, see the installation instructions). * Jupyter Notebook (to run the code, see the installation instructions).
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.032573454082012177, 0.00856885127723217, 0.016349075362086296, -0.019809279590845108, 0.058270130306482315, -0.014143265783786774, 0.01614360511302948, 0.011343705467879772, 0.038788989186286926, 0.031106671318411827, 0.0025901116896420717, -0.06290453672409058, 0.02396705374121666, 0.028524573892354965, -0.02128847874701023, 0.009253925643861294, -0.03819166496396065, -0.021862849593162537, -0.05448533967137337, 0.021670062094926834, -0.018689816817641258, -0.03999001905322075, -0.050927355885505676, -0.04312101751565933, 0.05025592818856239, 0.08919790387153625, 0.012565531767904758, -0.01867365464568138, -0.058374207466840744, -0.22755147516727448, 0.020657766610383987, -0.07244297862052917, 0.04817244037985802, -0.04738057032227516, 0.012536946684122086, -0.0004728920466732234, -0.003390191588550806, 0.05749959498643875, -0.010781990364193916, 0.03788627311587334, 0.057169314473867416, 0.018240181729197502, -0.03935486823320389, -0.0491856224834919, -0.03504277765750885, -0.07203443348407745, -0.012215345166623592, -0.017810864374041557, 0.011927327141165733, -0.014195897616446018, -0.04179644212126732, -0.01743346080183983, -0.021477051079273224, 0.02588825300335884, 0.023224594071507454, 0.036286525428295135, 0.07923270016908646, 0.02381456084549427, 0.03596975654363632, -0.010310499928891659, 0.059969425201416016, 0.012134638614952564, -0.17500664293766022, 0.08948463201522827, 0.013332569971680641, 0.051555052399635315, -0.014724591746926308, 0.0109221450984478, 0.038647767156362534, 0.010509106330573559, -0.055784210562705994, -0.0040966118685901165, -0.009264916181564331, 0.010206603445112705, 0.02181512676179409, 0.00884292833507061, -0.025884954258799553, -0.05787775665521622, -0.006634739227592945, 0.013730498030781746, -0.02890690229833126, -0.011927805840969086, -0.0012842376017943025, 0.01286895852535963, -0.00003270725210313685, -0.03694573789834976, 0.040561504662036896, -0.04089535400271416, -0.004536415450274944, 0.012740714475512505, -0.007427436765283346, -0.012382221408188343, -0.003333911532536149, 0.06007498502731323, -0.09049002826213837, -0.02055802196264267, 0.024825382977724075, 0.05106208100914955, 0.01317010447382927, 0.21431660652160645, -0.05752050504088402, 0.06082776188850403, 0.015421096235513687, -0.006960051599889994, 0.015707869082689285, -0.06850368529558182, 0.01780940778553486, -0.051075760275125504, -0.013143489137291908, 0.01785837858915329, -0.006129455752670765, -0.032105669379234314, 0.044865019619464874, -0.09009839594364166, 0.04185191169381142, -0.026251690462231636, -0.022035544738173485, 0.02618194743990898, -0.023140892386436462, 0.03272244334220886, 0.004308296367526054, 0.03878670558333397, 0.07161938399076462, -0.03133970499038696, 0.05062425509095192, -0.0007732038502581418, 0.0668756365776062, 0.09902280569076538, 0.004063738044351339, 0.01244392804801464, 0.010767709463834763, 0.005914425011724234, -0.11306429654359818, 0.024575037881731987, 0.009278583340346813, 0.012347962707281113, -0.04066906496882439, -0.001693648286163807, 0.04062005877494812, -0.014458034187555313, -0.01650998368859291, -0.07138541340827942, 0.0030133272521197796, -0.06868887692689896, -0.03729682415723801, 0.1304667443037033, -0.01694529689848423, 0.054586928337812424, -0.06386106461286545, -0.010220087133347988, -0.039539262652397156, 0.01893674023449421, -0.0429694838821888, -0.03368902578949928, 0.0068677575327456, 0.021308239549398422, 0.07525905966758728, 0.04987200349569321, -0.050286196172237396, -0.01489060465246439, -0.0681833028793335, -0.0025011764373630285, -0.030855543911457062, 0.062357716262340546, 0.023468658328056335, -0.14877241849899292, -0.009034653194248676, 0.040697455406188965, 0.0051294295117259026, -0.0504286102950573, 0.03018169477581978, 0.013850020244717598, -0.04534267261624336, 0.02236354909837246, 0.13866370916366577, 0.03672268986701965, -0.030942916870117188, 0.017019465565681458, 0.011330793611705303, -0.012620218098163605, 0.005214315373450518, -0.03023678995668888, -0.004572196863591671, 0.028215207159519196, -0.016980545595288277, -0.04043065384030342, -0.021022748202085495, -0.045983459800481796, 0.01565566286444664, 0.035658098757267, -0.0036396258510649204, -0.03665244206786156, 0.0050070276483893394, 0.016413569450378418, -0.01409462746232748, -0.03881445899605751, 0.0006438664277084172, -0.01919163390994072, 0.022350354120135307, -0.05522351711988449, 0.0559418722987175, -0.00433502160012722, 0.0021938281133770943, 0.052906863391399384, 0.02704455517232418, 0.005565566010773182, -0.058799661695957184, 0.0036396433133631945, 0.06957756727933884, -0.035598110407590866, -0.015163014642894268, 0.007400847040116787, 0.022315358743071556, -0.015823934227228165, -0.033241454511880875, 0.014986897818744183, 0.015979984775185585, 0.04736262187361717, 0.012650322169065475, 0.04002903029322624, 0.020698579028248787, -0.09495364129543304, -0.06589169055223465, -0.250503808259964, 0.00969769898802042, 0.009169516153633595, 0.05912082642316818, 0.011013268493115902, -0.054299671202898026, 0.010862145572900772, -0.004370869603008032, 0.03673835098743439, 0.06542006880044937, 0.06903264671564102, 0.007761422079056501, 0.003330050967633724, -0.02031947299838066, -0.03233398124575615, 0.06590036302804947, 0.028395740315318108, 0.032736048102378845, -0.05986800789833069, 0.020087046548724174, -0.004069862887263298, -0.012907791882753372, -0.01746009849011898, -0.07914990931749344, 0.029976001009345055, 0.026630254462361336, 0.18845245242118835, 0.004043613560497761, 0.01872871071100235, -0.048895224928855896, 0.05182172358036041, -0.032979901880025864, -0.03651227802038193, -0.09829481691122055, 0.04263046011328697, -0.0007818442536517978, 0.021084221079945564, 0.03763623908162117, -0.04277193918824196, -0.04247245192527771, -0.05109858140349388, 0.04852061718702316, 0.05037460848689079, -0.03451026231050491, -0.045966822654008865, -0.00657334178686142, -0.014141923747956753, -0.015940044075250626, -0.08078867942094803, 0.003988093230873346, -0.0034052326809614897, 0.013146099634468555, 0.08311350643634796, 0.003140064887702465, -0.03768705576658249, -0.044406868517398834, -0.06231844797730446, 0.05198975279927254, -0.05181969329714775, 0.051384586840867996, -0.017859797924757004, -0.023368090391159058, 0.05274156108498573, -0.056302934885025024, 0.041469018906354904, -0.03276286646723747, -0.0077956439927220345, -0.03356629237532616, 0.004234990105032921, -0.025981782004237175, -0.017362184822559357, 0.08621329069137573, -0.04371458664536476, 0.027270952239632607, 0.06789693981409073, 0.015137138776481152, 0.0012716074706986547, 0.002068169182166457, -0.02706747315824032, -0.03165271878242493, 0.042954664677381516, -0.02491995505988598, 0.03516468033194542, 0.07932423800230026, 0.06640786677598953, 0.01853916049003601, 0.06490939110517502, -0.02051246166229248, 0.012071935459971428, -0.011777603067457676, -0.008345963433384895, -0.031046520918607712, -0.04752581939101219, -0.014261672273278236, -0.012367460876703262, 0.0330706387758255, -0.29978787899017334, 0.04125697910785675, -0.028248131275177002, 0.015009809285402298, 0.004679109901189804, -0.02557487040758133, -0.00041975625208579004, 0.05428848788142204, -0.036084555089473724, 0.017073163762688637, 0.01187068596482277, 0.038277123123407364, 0.043095558881759644, -0.00854178611189127, -0.0077567328698933125, 0.05161828547716141, 0.03624438866972923, -0.03772810101509094, 0.036886733025312424, -0.02266487292945385, 0.056787505745887756, 0.06130503863096237, 0.217730313539505, 0.027468979358673096, 0.029490774497389793, 0.029189078137278557, 0.031923431903123856, 0.007659727241843939, 0.06924396753311157, 0.009447235614061356, 0.0006095124408602715, -0.01742255501449108, 0.08663512766361237, -0.019002487882971764, 0.027251772582530975, 0.07104000449180603, -0.052049420773983, 0.043116245418787, 0.04983643442392349, -0.039488840848207474, 0.0024523234460502863, 0.0105212377384305, -0.01425099465996027, 0.00942955445498228, 0.09253770858049393, -0.03432217240333557, -0.05915496498346329, -0.11243358999490738, 0.005867899861186743, 0.038200024515390396, -0.05888582020998001, -0.03966816887259483, -0.013111746869981289, 0.012057933025062084, 0.0060533261857926846, 0.0319378562271595, -0.006305552553385496, 0.010713472962379456, -0.00008915649232221767, -0.05437501147389412, 0.020580429583787918, -0.1244143471121788, 0.005849574226886034, -0.01467681024223566, 0.009487541392445564 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
>Note: Before running any code or installing any Python packages, we strongly recommend setting up a separate Python environment. This helps to isolate dependencies, manage packages, and avoid conflicts that may arise from different package versions. Creating an environment is an optional but highly recommended step. At this point, we are assuming that you have an Atlas cluster created and ready to be used, and PyMongo and Jupyter Notebook installed. Let’s go ahead and launch Jupyter Notebook by running the following command in the terminal: ``` Jupyter Notebook ``` Once you have the Jupyter Notebook up and running, let’s go ahead and fetch the connection string of your MongoDB Atlas cluster and store that as an environment variable, which we will use later to connect to our database. After you have done that, let’s go ahead and connect to our Atlas cluster by running the following commands: ``` import pymongo import os from pymongo import MongoClient
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.04386018589138985, -0.003356406930834055, 0.018787220120429993, -0.031067360192537308, -0.007703299168497324, -0.03215634450316429, -0.00855077151209116, 0.012959943152964115, -0.002509333658963442, -0.005472216755151749, 0.021563204005360603, -0.08182912319898605, 0.02342536486685276, 0.00016862548363860697, -0.024346034973859787, 0.005457338877022266, -0.026895374059677124, -0.022675802931189537, -0.0513794869184494, 0.019168106839060783, -0.05004512891173363, -0.017662664875388145, -0.03510381281375885, -0.061262380331754684, 0.028559615835547447, 0.100778728723526, -0.016498591750860214, -0.03373734652996063, -0.03563368692994118, -0.22271543741226196, 0.003360008355230093, -0.052871350198984146, 0.011670772917568684, -0.0360640324652195, 0.007743265945464373, 0.037043873220682144, 0.016764160245656967, 0.04558182135224342, -0.03042665868997574, 0.035971906036138535, 0.061091333627700806, -0.00044915598118677735, -0.037191856652498245, -0.02682279795408249, -0.017531804740428925, -0.07346442341804504, -0.017322340980172157, -0.024678602814674377, 0.051680777221918106, -0.04902090132236481, -0.008351527154445648, -0.05397384613752365, -0.03690518066287041, 0.0007052224245853722, -0.0245086457580328, 0.048122014850378036, 0.05641216039657593, 0.05644875764846802, -0.0014028100995346904, 0.014864659868180752, 0.02924809604883194, 0.0451749749481678, -0.20345015823841095, 0.11219199746847153, 0.047297876328229904, 0.0528375618159771, -0.035627879202365875, 0.003779297461733222, 0.05436013638973236, 0.04257357865571976, -0.08312229812145233, 0.02396260015666485, -0.009423092938959599, 0.04939412698149681, 0.0214250311255455, -0.019629187881946564, -0.015392720699310303, -0.03308742493391037, 0.024668412283062935, 0.0013295408571138978, -0.030606472864747047, -0.008459371514618397, -0.02584608644247055, 0.04737197980284691, -0.024541517719626427, -0.016028236597776413, 0.023886146023869514, -0.001254378934390843, 0.014777788892388344, -0.004864179529249668, 0.0091007761657238, -0.025942005217075348, 0.017870081588625908, 0.06459391117095947, -0.07727256417274475, 0.0038518800865858793, 0.030864566564559937, 0.005606736056506634, -0.014111792668700218, 0.2287922203540802, -0.03348224610090256, 0.03279697522521019, 0.012839145958423615, 0.0037511440459638834, 0.01675032451748848, -0.051586560904979706, -0.000023628103008377366, -0.05027427151799202, -0.011359727941453457, -0.019231237471103668, 0.02537318877875805, -0.022923318669199944, 0.03623608872294426, -0.0668170377612114, 0.03378564491868019, 0.007745195645838976, -0.027098875492811203, 0.01844342239201069, -0.023196766152977943, 0.016840513795614243, -0.009414063766598701, 0.019155090674757957, 0.06009441986680031, 0.0012993316631764174, 0.04207313060760498, -0.005316799506545067, 0.02759159542620182, 0.06782576441764832, 0.013662087731063366, 0.03189874067902565, 0.018204113468527794, -0.013661081902682781, -0.05631226673722267, 0.0218781977891922, 0.02431667223572731, -0.01359790749847889, -0.027498960494995117, 0.03233100846409798, 0.017104407772421837, -0.0002659392775967717, -0.02809329330921173, -0.08884704858064651, 0.007862008176743984, -0.08536799252033234, -0.04165477305650711, 0.1002035140991211, -0.06089842692017555, 0.08335081487894058, -0.05943832919001579, -0.019773155450820923, -0.018581099808216095, 0.012124852277338505, -0.05153496190905571, 0.007674315478652716, 0.011205009184777737, 0.03158314898610115, 0.051430147141218185, 0.08161533623933792, -0.030767230316996574, -0.02010597474873066, -0.055196527391672134, -0.04908249154686928, -0.05647147074341774, 0.08370862156152725, 0.00518436124548316, -0.11626925319433212, -0.000446302758064121, 0.0001681931025814265, 0.010106475092470646, -0.02537630870938301, -0.01620272547006607, 0.03011174127459526, -0.025678066536784172, 0.009560570120811462, 0.12464600056409836, 0.008068745024502277, -0.05617860332131386, 0.02001839689910412, 0.009402267634868622, -0.0006552597624249756, 0.006862406153231859, -0.012365982867777348, -0.02582355961203575, -0.012267278507351875, 0.026181094348430634, -0.06817307323217392, -0.007901044562458992, -0.03488108143210411, 0.030209064483642578, 0.023723436519503593, -0.019964054226875305, 0.033481013029813766, 0.04197925329208374, -0.055011022835969925, -0.020159682258963585, -0.031703706830739975, -0.014793775975704193, -0.013533255085349083, 0.009038290940225124, -0.03591238707304001, 0.08777935802936554, 0.049451276659965515, -0.021938739344477654, 0.07151618599891663, -0.0004528409626800567, 0.004416350740939379, -0.044514235109090805, -0.01958833448588848, 0.053701214492321014, -0.016086403280496597, -0.045814212411642075, 0.0017444832483306527, 0.04444851353764534, -0.008413175120949745, -0.02667918987572193, 0.010184001177549362, 0.03773147985339165, 0.05973866209387779, 0.07287388294935226, 0.06052544713020325, 0.012237186543643475, -0.07641100883483887, -0.059206120669841766, -0.26471149921417236, 0.047151949256658554, 0.012631760910153389, 0.024394938722252846, 0.007899155840277672, -0.03870692476630211, 0.031157132238149643, -0.0015800405526533723, -0.011701727285981178, 0.050116512924432755, 0.09358939528465271, -0.003302271943539381, 0.019997382536530495, 0.03656250610947609, -0.04813184589147568, 0.09738987684249878, 0.027124017477035522, 0.02820887789130211, -0.049718648195266724, 0.010896943509578705, 0.0016343187307938933, -0.040448129177093506, -0.03120804950594902, -0.046570613980293274, 0.02044377289712429, -0.008080515079200268, 0.21009837090969086, 0.030917804688215256, 0.014089347794651985, -0.037967417389154434, 0.057418130338191986, 0.0006253693136386573, -0.05349896103143692, -0.16502685844898224, 0.043369412422180176, 0.01475643552839756, 0.03130682185292244, 0.031602200120687485, -0.007707306649535894, -0.008564557880163193, -0.01575656607747078, 0.0635744035243988, 0.022207563742995262, -0.06006631627678871, -0.0008791969739831984, -0.010432761162519455, -0.006109639536589384, 0.014603903517127037, -0.04878796637058258, 0.003401470370590687, -0.014676383696496487, 0.06169265881180763, 0.037882283329963684, 0.009758520871400833, -0.05181322246789932, -0.042255375534296036, -0.05960896238684654, 0.05437743291258812, -0.04360531270503998, 0.06585961580276489, -0.001477845711633563, -0.030430911108851433, 0.01376193668693304, -0.046872176229953766, 0.034510210156440735, -0.034113917499780655, 0.015801722183823586, -0.04153694212436676, 0.07619735598564148, 0.000020132440113229677, 0.0017330539412796497, 0.058716464787721634, -0.028866777196526527, 0.021762380376458168, 0.04087795689702034, 0.032005585730075836, 0.03359174728393555, 0.002535360399633646, -0.020758207887411118, -0.013901393860578537, 0.04447624459862709, -0.015154246240854263, 0.018983226269483566, 0.07909330725669861, 0.029733842238783836, 0.010725858621299267, 0.0024254166055470705, -0.022070450708270073, 0.015456169843673706, -0.030483515933156013, -0.008910548873245716, -0.019312875345349312, -0.03151111677289009, 0.007626102771610022, 0.04069484770298004, 0.022358328104019165, -0.28226232528686523, 0.048170849680900574, -0.0355905182659626, 0.001187349553219974, -0.010610598139464855, -0.01269663218408823, 0.04400460049510002, 0.01332246046513319, -0.06585784256458282, 0.017313094809651375, 0.057644378393888474, 0.0032653342932462692, 0.03349395841360092, -0.0023322398774325848, 0.01736762560904026, 0.037510037422180176, 0.05336102098226547, -0.03220933675765991, 0.023100417107343674, -0.03177874907851219, 0.011231214739382267, 0.01641424186527729, 0.20502106845378876, 0.0020130446646362543, 0.05525399371981621, 0.05276491865515709, 0.019283009693026543, 0.05496591329574585, 0.03406469151377678, -0.002940765116363764, -0.003358167130500078, -0.012991528958082199, 0.05716872215270996, -0.05701932683587074, 0.04245372861623764, 0.03632082790136337, -0.04047275707125664, -0.005006798077374697, 0.06605106592178345, -0.03942197933793068, -0.021371159702539444, 0.010311201214790344, -0.042970478534698486, -0.018146177753806114, 0.1078413724899292, -0.02349650301039219, -0.021004125475883484, -0.09360058605670929, -0.00863882526755333, 0.016292916610836983, -0.056188274174928665, -0.03042747639119625, -0.01595243811607361, -0.027679771184921265, 0.01248205453157425, 0.021932965144515038, -0.004530849400907755, -0.004905289970338345, -0.018417401239275932, -0.029617933556437492, 0.03300416097044945, -0.1744406819343567, 0.04396974667906761, 0.03653866797685623, -0.002223973162472248 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
``` import pymongo import os from pymongo import MongoClient MONGO_CONN_STRING = os.environ.get("MONGODB_CONNECTION_STRING") client = MongoClient(MONGO_CONN_STRING) ``` ## Creating a time-series collection Next, we are going to create a new database and a collection in our cluster to store the time-series data. We will call this database “stock_data” and the collection “stocks”. ``` # Let's create a new database called "stock data" db = client.stock_data # Let's create a new time-series collection in the "stock data" database called "stocks" collection = db.create_collection('stocks', timeseries={ timeField: "timestamp", metaField: "metadata", granularity: "hours"
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.03470398485660553, 0.02037637121975422, 0.020632611587643623, -0.02892887033522129, 0.04226795956492424, -0.013874098658561707, 0.0049956198781728745, -0.0023642193991690874, 0.028369830921292305, 0.006251920945942402, -0.016853084787726402, -0.10466556996107101, 0.022274671122431755, 0.03753227740526199, -0.02028103731572628, 0.00017605711764190346, -0.03530487045645714, -0.010688620619475842, -0.05609818547964096, 0.024922676384449005, 0.0015449970960617065, -0.01928243786096573, -0.044826313853263855, -0.035957757383584976, 0.04733896255493164, 0.07953178137540817, 0.007452444173395634, 0.00976825226098299, -0.04657363519072533, -0.21030215919017792, -0.022357143461704254, -0.062364883720874786, 0.022450165823101997, -0.035384345799684525, 0.018565181642770767, -0.009648672305047512, -0.0049777342937886715, 0.059401948004961014, -0.03045704774558544, 0.08334317803382874, 0.05656225234270096, 0.003489677095785737, -0.0542093925178051, -0.06277082860469818, -0.02293512038886547, -0.06532587110996246, -0.020508088171482086, -0.042354606091976166, 0.015367942862212658, -0.020748140290379524, -0.03851047158241272, -0.016011547297239304, -0.0406845398247242, 0.00782789383083582, 0.010732599534094334, 0.0429825522005558, 0.03764364868402481, 0.021212134510278702, 0.027433374896645546, -0.01333952322602272, 0.0665864571928978, 0.030743902549147606, -0.1807079166173935, 0.10391774028539658, 0.017536846920847893, 0.04823342710733414, -0.010529122315347195, 0.011208334937691689, 0.04392756149172783, 0.026695476844906807, -0.042356401681900024, 0.015095503069460392, 0.017442069947719574, 0.027904953807592392, 0.00739722466096282, -0.035890307277441025, -0.016001494601368904, -0.0707196593284607, 0.006206438411027193, 0.031246980652213097, -0.04562946781516075, -0.03771016746759415, -0.023957157507538795, 0.003974501043558121, -0.00956068467348814, -0.017986061051487923, 0.03492516651749611, -0.03406403213739395, 0.008526491932570934, 0.01613607443869114, -0.017591798678040504, -0.0151975704357028, 0.015056450851261616, 0.029168713837862015, -0.08177469670772552, 0.004686867352575064, 0.016635507345199585, 0.03431214392185211, -0.015174242667853832, 0.2274160087108612, -0.05138794705271721, 0.06060216575860977, 0.005620039068162441, -0.02970591001212597, 0.022442065179347992, -0.04768338054418564, -0.0055174510926008224, -0.07239745557308197, -0.013466558419167995, 0.00754897017031908, -0.00010903523798333481, -0.01989196240901947, 0.016819894313812256, -0.09106310456991196, 0.023683274164795876, 0.01714594103395939, -0.042287733405828476, 0.0336771123111248, -0.039749350398778915, 0.035142578184604645, 0.008285770192742348, 0.02372225560247898, 0.0301812794059515, -0.01919412426650524, 0.03222393989562988, 0.00417819619178772, 0.05655509978532791, 0.09473659098148346, -0.0019885210786014795, 0.04083704575896263, 0.020756138488650322, -0.0021438084077090025, -0.08007578551769257, 0.015304602682590485, 0.02116255834698677, -0.007130719255656004, -0.002468828111886978, 0.007312638685107231, 0.0566876158118248, 0.009450088255107403, -0.039516981691122055, -0.08352499455213547, -0.021702362224459648, -0.08373580873012543, -0.02099885419011116, 0.12246790528297424, -0.00855528935790062, 0.08359984308481216, -0.060174647718667984, -0.0182449072599411, -0.039633553475141525, 0.01690032333135605, -0.03201912343502045, -0.04714967682957649, 0.013646305538713932, 0.005922590382397175, 0.0651666447520256, 0.04102787747979164, -0.0031396530102938414, -0.020872989669442177, -0.06304362416267395, -0.006991159170866013, -0.024554571136832237, 0.09673070162534714, -0.005569151137024164, -0.10919418931007385, 0.010066711343824863, 0.0383029542863369, 0.0034128171391785145, -0.05376642569899559, 0.001169520546682179, 0.023923397064208984, -0.06257908046245575, 0.017437690868973732, 0.12856845557689667, 0.02790965512394905, -0.025763051584362984, -0.026166576892137527, 0.027721771970391273, -0.01741228997707367, 0.00379810924641788, -0.016789428889751434, -0.01830766163766384, 0.019984737038612366, -0.0003191713767591864, -0.057277269661426544, -0.01003952044993639, -0.040022559463977814, 0.009479139000177383, 0.044920943677425385, 0.0004732479283120483, -0.0011679374147206545, 0.0197792686522007, 0.0024511574301868677, -0.033850133419036865, -0.05614202469587326, -0.010430515743792057, -0.019926272332668304, -0.004412917420268059, -0.047246161848306656, 0.06588683277368546, 0.04066360369324684, -0.008812437765300274, 0.04321976378560066, 0.0030421351548284292, 0.024648062884807587, -0.04193578660488129, -0.0193487536162138, 0.05828550457954407, -0.021697605028748512, -0.03382176533341408, 0.008206936530768871, 0.04801226034760475, 0.00561031699180603, -0.03407669812440872, 0.0138397840783, 0.02354400046169758, 0.022213231772184372, 0.0579058863222599, 0.037317223846912384, 0.007619322743266821, -0.05321961268782616, -0.04550844430923462, -0.27324178814888, 0.040997035801410675, -0.022556576877832413, 0.021010013297200203, 0.008010859601199627, -0.025298116728663445, 0.0043077971786260605, -0.00019195729692000896, -0.008566850796341896, 0.0634927898645401, 0.09227167814970016, 0.01073190476745367, 0.013405303470790386, 0.020538322627544403, -0.03043242357671261, 0.06818787753582001, 0.012836551293730736, 0.013879671692848206, -0.042514368891716, 0.014498092234134674, -0.025794247165322304, -0.015071161091327667, -0.03456608206033707, -0.08612179011106491, 0.033725615590810776, 0.02554304525256157, 0.1882147192955017, 0.030286753550171852, -0.0019269436597824097, -0.04606027528643608, 0.07749832421541214, -0.0179720651358366, -0.04586152732372284, -0.1067039743065834, 0.01601535454392433, 0.024457987397909164, 0.030554769560694695, 0.06592096388339996, -0.009820706211030483, -0.029533371329307556, -0.042926009744405746, 0.04697105661034584, 0.03527272492647171, -0.03242545574903488, -0.026921629905700684, -0.012785341590642929, -0.03628762811422348, 0.01985808275640011, -0.04297418147325516, 0.009136080741882324, 0.00720237148925662, 0.0223053190857172, 0.05667952075600624, 0.007416009437292814, -0.03429712727665901, -0.054688140749931335, -0.07121358811855316, 0.03656848147511482, -0.02206679992377758, 0.05586827173829079, 0.00014880731760058552, -0.018579918891191483, 0.028790706768631935, -0.028028568252921104, 0.05695360526442528, -0.014835928566753864, -0.0020188509952276945, -0.03707471489906311, 0.012171969749033451, -0.04393372684717178, 0.00778968445956707, 0.0819990411400795, -0.03465643152594566, 0.03563159704208374, 0.04139167070388794, 0.0419854037463665, 0.009159596636891365, -0.005564413499087095, -0.05223815143108368, -0.013812038116157055, 0.046115659177303314, -0.018461821600794792, 0.03523288667201996, 0.11685431003570557, 0.0545022152364254, 0.011472928337752819, 0.04380296543240547, -0.013592946343123913, 0.02174549363553524, -0.03804554045200348, -0.028431318700313568, -0.026223307475447655, -0.05703837797045708, -0.0017016638303175569, 0.030594883486628532, 0.01646047830581665, -0.3161085844039917, 0.055242132395505905, -0.014302571304142475, 0.009887986816465855, -0.002306154929101467, 0.001989947631955147, 0.004544047173112631, 0.03985323756933212, -0.028317073360085487, 0.018076488748192787, 0.021855559200048447, 0.02068399079144001, 0.0308174267411232, 0.013125837780535221, -0.01114202942699194, 0.06761611998081207, 0.03569495305418968, -0.04737464711070061, 0.07184088975191116, -0.009156676940619946, 0.046008411794900894, 0.038656335324048996, 0.215647354722023, -0.005142033100128174, 0.05279228836297989, 0.058547571301460266, 0.005697001703083515, 0.026950065046548843, 0.05706271529197693, 0.02491503767669201, 0.012455970980226994, -0.011704731732606888, 0.09150377660989761, -0.033564552664756775, 0.04242948442697525, 0.04053979367017746, -0.052903417497873306, 0.02003350667655468, 0.03038812056183815, -0.03778872266411781, -0.06265665590763092, -0.0017641889862716198, -0.02000107429921627, -0.0031489368993788958, 0.11402627825737, -0.041392143815755844, -0.047704730182886124, -0.11060207337141037, 0.005710687022656202, 0.00991995818912983, -0.10725820809602737, -0.03571580722928047, -0.015913579612970352, -0.0039154402911663055, 0.014182512648403645, 0.03264838829636574, 0.0009793585631996393, 0.02630319632589817, 0.005018799565732479, -0.02734312415122986, 0.021122777834534645, -0.11706556379795074, 0.0012032410595566034, 0.0005363746895454824, 0.01337939128279686 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
timeField: "timestamp", metaField: "metadata", granularity: "hours" }) ``` Here, we used the db.create_collection() method to create a time-series collection called “stock”. In the example above, “timeField”, “metaField”, and “granularity” are reserved fields (for more information on what these are, visit our documentation). The “timeField” option specifies the name of the field in your collection that will contain the date in each time-series document. The “metaField” option specifies the name of the field in your collection that will contain the metadata in each time-series document. Finally, the “granularity” option specifies how frequently data will be ingested in your time-series collection. Now, let’s insert some stock-related information into our collection. We are interested in storing and analyzing the stock of a specific company called “XYZ” which trades its stock on “NASDAQ”.
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.007283143233507872, -0.0360238179564476, 0.018067574128508568, -0.0043113501742482185, 0.053505368530750275, -0.00604756036773324, 0.04005758464336395, -0.019382478669285774, 0.050368763506412506, -0.00763551564887166, -0.002951798029243946, -0.03941888362169266, 0.01129188109189272, 0.026950741186738014, -0.022877225652337074, 0.0026891049928963184, -0.0378134623169899, -0.023407207801938057, -0.05040810629725456, 0.013422095216810703, 0.07452978938817978, -0.027570614591240883, -0.017444932833313942, -0.03789621591567993, 0.03727869689464569, 0.04695089906454086, -0.037702664732933044, 0.010032531805336475, -0.08545280992984772, -0.2183505743741989, 0.027909282594919205, -0.03627965599298477, 0.022867748513817787, -0.01583750732243061, 0.022627590224146843, -0.026919394731521606, -0.021808624267578125, 0.07060828059911728, -0.030700545758008957, 0.05866406112909317, 0.025647222995758057, 0.02610182575881481, -0.022760719060897827, -0.06322814524173737, -0.05574384704232216, -0.05359970033168793, -0.02211027964949608, -0.00599076971411705, 0.005509059876203537, 0.021337874233722687, -0.014253096655011177, -0.00040027237264439464, -0.022301845252513885, 0.007654803339391947, 0.019243905320763588, 0.05868062004446983, 0.09718473255634308, 0.021527180448174477, 0.04152299463748932, -0.011642780154943466, 0.06855382025241852, 0.02770346775650978, -0.17308948934078217, 0.07628501206636429, 0.029440410435199738, 0.0536205992102623, -0.009905033744871616, -0.010967808775603771, 0.020451661199331284, 0.014641103334724903, -0.025864403694868088, -0.01937594823539257, -0.03565765917301178, 0.05854877084493637, 0.018009932711720467, -0.009540244936943054, -0.036904480308294296, -0.07242763042449951, -0.027804328128695488, 0.02801334671676159, -0.01650845818221569, -0.012977884151041508, -0.03875809907913208, 0.009544405154883862, -0.023252349346876144, 0.004042070358991623, 0.03986353799700737, -0.07999537885189056, 0.03099522925913334, 0.028215400874614716, -0.008837834931910038, -0.034638289362192154, -0.016690343618392944, 0.007816825993359089, -0.08066709339618683, -0.03595881536602974, 0.00019037122547160834, 0.05313907563686371, -0.014024236239492893, 0.2133488655090332, -0.03190525621175766, 0.04103633761405945, 0.025725390762090683, -0.005378697067499161, -0.0010834101121872663, -0.05625678226351738, -0.05113475024700165, -0.03050152026116848, -0.014210428111255169, 0.009902825579047203, 0.0033112382516264915, 0.003051480744034052, 0.021686801686882973, -0.10949908196926117, 0.012135697528719902, 0.008651516400277615, 0.014687989838421345, 0.02378947101533413, -0.012332986108958721, -0.003598439507186413, 0.011150579899549484, 0.03625670075416565, 0.02267347276210785, -0.02323334291577339, -0.0026573603972792625, -0.045843638479709625, 0.0601997934281826, 0.11222931742668152, 0.0161049235612154, 0.002714956644922495, 0.04718510061502457, -0.010225814767181873, -0.08696606755256653, -0.026926713064312935, 0.026398539543151855, 0.004559212829917669, -0.011114656925201416, 0.025834564119577408, 0.022051306441426277, 0.0060172006487846375, -0.06290923058986664, -0.0973581001162529, -0.013753620907664299, -0.06508075445890427, -0.05394216999411583, 0.170070081949234, -0.023415153846144676, 0.027956681326031685, -0.04399581626057625, 0.01717665046453476, -0.08365711569786072, 0.030984003096818924, -0.04755864664912224, -0.04563383385539055, 0.02430678717792034, 0.018355417996644974, 0.05943979322910309, 0.03251200169324875, -0.03145812079310417, -0.031168285757303238, -0.07367797940969467, -0.054151684045791626, -0.019292358309030533, 0.14798963069915771, 0.0044624158181250095, -0.1030382290482521, -0.06566699594259262, 0.037237219512462616, 0.0039804051630198956, -0.035564277321100235, 0.03399433195590973, 0.01849442906677723, -0.03423108160495758, 0.031055964529514313, 0.09643802791833878, 0.024663925170898438, -0.017253557220101357, -0.010001207701861858, 0.03826048597693443, -0.001973554026335478, 0.05977892875671387, -0.03639083355665207, -0.024695806205272675, 0.05546311289072037, 0.004092541988939047, -0.042127158492803574, -0.013898174278438091, -0.049490537494421005, 0.01831238716840744, 0.04815661534667015, -0.011607619933784008, 0.021454578265547752, -0.006157581694424152, 0.016017070040106773, -0.03758188337087631, -0.022955846041440964, -0.006115421652793884, 0.010996033437550068, 0.023298462852835655, -0.037751227617263794, 0.02581259049475193, 0.029212674126029015, -0.03233018517494202, 0.05602508410811424, 0.03606950491666794, -0.0034356724936515093, -0.03280026838183403, -0.0214749313890934, 0.030991701409220695, -0.0014084629947319627, -0.05775707960128784, 0.02388213761150837, 0.026303621008992195, 0.024246588349342346, -0.015673071146011353, 0.04356226697564125, 0.013238090090453625, 0.009064086712896824, 0.0018088462529703975, 0.061450663954019547, 0.011278840713202953, -0.05709763243794441, -0.028783215209841728, -0.2447766810655594, 0.017927417531609535, -0.03139004111289978, 0.000844389374833554, 0.013534216210246086, -0.05615011602640152, 0.0017365111270919442, -0.04925069212913513, 0.017369097098708153, 0.05874962732195854, 0.07599518448114395, -0.02317187376320362, -0.0036905966699123383, -0.03338555619120598, -0.029380662366747856, 0.06689874827861786, -0.011405901983380318, 0.012934578582644463, -0.05476608872413635, 0.014886635355651379, -0.005226439796388149, 0.012252125889062881, -0.027081338688731194, -0.053994808346033096, 0.05912353843450546, 0.029294690117239952, 0.19804340600967407, 0.035748668015003204, -0.01291984785348177, -0.036133334040641785, 0.07659687846899033, 0.013985707424581051, -0.012549512088298798, -0.07764416933059692, 0.008621005341410637, -0.003771614283323288, 0.002578043146058917, -0.007286562584340572, -0.0685538649559021, -0.011992157436907291, -0.0708409920334816, 0.01917976140975952, 0.029337024316191673, -0.08374367654323578, -0.027551015838980675, -0.006865954492241144, -0.027291418984532356, 0.002887745387852192, -0.04575255140662193, 0.04239320009946823, 0.03477945551276207, -0.03685940429568291, 0.035047173500061035, 0.033991288393735886, 0.034713830798864365, -0.04824592173099518, -0.05740495026111603, 0.03160984441637993, -0.0036691944114863873, 0.08011604100465775, 0.0002011457399930805, 0.007633042987436056, 0.03095225617289543, -0.03825121745467186, 0.027034049853682518, -0.029991788789629936, -0.039540477097034454, -0.05810520425438881, -0.02969704382121563, -0.08109384775161743, -0.0016239158576354384, 0.09948460012674332, -0.037018220871686935, 0.023724472150206566, 0.061670634895563126, -0.005582095589488745, 0.002671654336154461, 0.009362464770674706, -0.014677712693810463, -0.0071353185921907425, 0.029423018917441368, 0.012362048029899597, 0.07749661803245544, 0.08227790892124176, 0.05952074006199837, 0.003261658363044262, 0.06285866349935532, -0.039809051901102066, 0.020195001736283302, -0.012821225449442863, -0.028615806251764297, 0.0006516457651741803, -0.028497759252786636, -0.034888021647930145, 0.04238440841436386, -0.012737593613564968, -0.30006304383277893, 0.0927196741104126, 0.01859874837100506, 0.01830923557281494, -0.009744808077812195, 0.013841022737324238, 0.005749181844294071, 0.07115297019481659, -0.03335244953632355, -0.0019471138948574662, 0.0018346864962950349, 0.03746625781059265, 0.038557782769203186, -0.006125518586486578, 0.01048562116920948, 0.044730376452207565, 0.06509706377983093, -0.04099161550402641, 0.053786881268024445, -0.03369084745645523, 0.05745943263173103, 0.011945109814405441, 0.23668040335178375, 0.020842961966991425, 0.0258845966309309, 0.019077692180871964, 0.0005187183269299567, 0.016838058829307556, 0.02753291092813015, 0.030447043478488922, 0.04858260974287987, -0.006656238809227943, 0.13063690066337585, -0.005501298233866692, 0.002045778091996908, 0.03018789552152157, -0.0454166978597641, 0.061525385826826096, 0.014151319861412048, -0.022995611652731895, -0.06113939732313156, 0.008148140273988247, -0.0713864341378212, -0.0013872060226276517, 0.07948408275842667, -0.0491076335310936, -0.017819251865148544, -0.06904831528663635, -0.003723815316334367, 0.01586063578724861, -0.08583280444145203, 0.0151533093303442, -0.0214115921407938, 0.0011411341838538647, 0.012159457430243492, 0.02005678042769432, -0.0019460543990135193, -0.00003569148248061538, -0.00036055539385415614, 0.009639516472816467, -0.025508012622594833, -0.06439118087291718, 0.00028089593979530036, -0.009845019318163395, 0.028317566961050034 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
We are storing some price metrics of this stock at an hourly interval and for each time interval, we are storing the following information: * **open:** the opening price at which the stock traded when the market opened * **close:** the final price at which the stock traded when the trading period ended * **high:** the highest price at which the stock traded during the trading period * **low:** the lowest price at which the stock traded during the trading period * **volume:** the total number of shares traded during the trading period Now that we have become an expert on stock trading and terminology (sarcasm), we will now insert some documents into our time-series collection. Here we have four sample documents. The data points are captured at an interval of one hour. ``` # Create some sample data
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.0289372019469738, -0.005756106227636337, 0.028133099898695946, -0.006204315926879644, 0.047459352761507034, 0.020132794976234436, 0.03826991841197014, 0.02221592143177986, 0.05162712186574936, -0.011748210527002811, -0.00811641663312912, -0.05436116084456444, 0.014850490726530552, 0.05203000456094742, -0.009462469257414341, 0.007415982894599438, 0.005199449602514505, -0.0366935171186924, -0.06303047388792038, 0.05899021029472351, 0.054862480610609055, -0.054261524230241776, -0.0017459142254665494, -0.02634465880692005, 0.0630006492137909, 0.013088595122098923, -0.0038244565948843956, -0.03738608956336975, -0.06625476479530334, -0.19909526407718658, 0.0056953770108520985, -0.04603331536054611, 0.05162138491868973, -0.03110024891793728, 0.002045602072030306, 0.011442133225500584, -0.04645654186606407, 0.05394236370921135, -0.01869443990290165, 0.04221465438604355, 0.025533130392432213, 0.003538462333381176, -0.034486494958400726, -0.032024648040533066, -0.048072099685668945, -0.06579386442899704, -0.017487410455942154, -0.005471708718687296, -0.006426503881812096, 0.038484252989292145, -0.03734729811549187, -0.020953865721821785, 0.008424179628491402, -0.000027753985705203377, 0.0021227679681032896, 0.05008479580283165, 0.0657762736082077, -0.0020003668032586575, 0.04536712169647217, 0.02806924469769001, 0.08410104364156723, 0.026748141273856163, -0.18716536462306976, 0.08619818836450577, -0.025453925132751465, 0.011501778848469257, -0.03926517441868782, -0.0013269638875499368, -0.005055360496044159, 0.028637414798140526, -0.054839201271533966, -0.0013407720252871513, 0.031240930780768394, 0.005335415247827768, 0.020682862028479576, -0.0316997654736042, -0.0006326371221803129, -0.037090133875608444, 0.010459402576088905, 0.01726706512272358, -0.009257440455257893, -0.034883491694927216, -0.016922112554311752, -0.008445960469543934, -0.03178522735834122, -0.0304410420358181, 0.0775177851319313, -0.045897677540779114, 0.030489522963762283, 0.029061265289783478, -0.016076309606432915, -0.0037248902954161167, -0.04291248321533203, 0.024001168087124825, -0.08721879869699478, -0.03655701503157616, 0.057597558945417404, 0.04428733512759209, -0.033198073506355286, 0.19352802634239197, -0.033184029161930084, 0.011119341477751732, 0.01733406074345112, -0.058316800743341446, 0.0018553633708506823, -0.06034141406416893, -0.054113298654556274, -0.035852596163749695, -0.008889851160347462, -0.001610171515494585, -0.04016037657856941, -0.0212926734238863, 0.033329930156469345, -0.04258030652999878, 0.026792846620082855, 0.005314517766237259, 0.025796426460146904, -0.021450776606798172, 0.009269515983760357, 0.005439376924186945, -0.004146566614508629, 0.03428083658218384, 0.024118918925523758, -0.045307569205760956, 0.04407414048910141, -0.05686434730887413, 0.09060176461935043, 0.10056649148464203, 0.018717562779784203, 0.011660801246762276, 0.055951494723558426, 0.005959346890449524, -0.08734288811683655, 0.005934323184192181, 0.018493490293622017, 0.0210745669901371, 0.00046969199320301414, 0.010377506725490093, 0.03619314357638359, -0.004819844383746386, -0.07722257822751999, -0.08854138851165771, -0.0064294589683413506, -0.09831834584474564, -0.041684892028570175, 0.15359047055244446, 0.003938028588891029, 0.010975105687975883, -0.046224843710660934, -0.0296371728181839, -0.05001145973801613, 0.001192852039821446, -0.005051415413618088, -0.05639483407139778, -0.013020292855799198, 0.023063715547323227, 0.06415726989507675, 0.06654900312423706, -0.022335851565003395, -0.004837727639824152, -0.07740169763565063, -0.030278868973255157, -0.01576850190758705, 0.1425001621246338, 0.02090793289244175, -0.10819872468709946, -0.031873125582933426, 0.014378555119037628, 0.011863922700285912, -0.018843868747353554, 0.07020170986652374, 0.03107054904103279, -0.0344950295984745, 0.03774857893586159, 0.11854395270347595, 0.0145622743293643, -0.006972558330744505, -0.0028742572758346796, 0.00976746715605259, -0.004792964085936546, 0.06467518210411072, -0.06510375440120697, -0.05875297635793686, 0.026636727154254913, 0.008924871683120728, -0.041094888001680374, -0.04938415810465813, -0.058322545140981674, 0.024793840944767, 0.08738014101982117, -0.04444189369678497, -0.007212452124804258, -0.025175221264362335, 0.038442689925432205, -0.08082934468984604, -0.03651461377739906, -0.029377665370702744, -0.002617052523419261, -0.010391540825366974, -0.044231195002794266, 0.05190100893378258, -0.014326277188956738, -0.017257537692785263, 0.056432779878377914, 0.04386990889906883, 0.03122352994978428, -0.006533932406455278, 0.035377081483602524, 0.08966958522796631, -0.0005396893830038607, -0.025222284719347954, 0.028640901669859886, 0.00903125386685133, -0.015126383863389492, -0.024713294580578804, 0.007160298991948366, 0.0014346783282235265, 0.06812603771686554, 0.0218496210873127, 0.05491224303841591, 0.014179360121488571, -0.037602923810482025, -0.02289406768977642, -0.24152949452400208, 0.0025973913725465536, 0.011316929012537003, 0.00309058022685349, 0.08280200511217117, -0.03209239989519119, 0.025256510823965073, -0.009364930912852287, 0.050225306302309036, 0.06172355264425278, 0.0769856721162796, -0.039946310222148895, -0.01726844534277916, -0.043164774775505066, 0.00238063745200634, 0.03132179006934166, 0.006408735178411007, 0.022125694900751114, -0.05922555550932884, 0.028223736211657524, -0.03735795244574547, 0.043649833649396896, -0.043262071907520294, -0.053784556686878204, 0.09160765260457993, 0.01765415258705616, 0.19417481124401093, 0.016600394621491432, 0.03048553504049778, -0.0245733093470335, 0.05316028743982315, -0.03140057250857353, -0.024357153102755547, -0.03665466979146004, 0.04309774190187454, 0.026138776913285255, -0.000518159766215831, 0.01539460476487875, -0.042780883610248566, -0.029540853574872017, -0.06754064559936523, 0.03054439276456833, 0.026421990245580673, -0.032005246728658676, -0.021124310791492462, -0.022134650498628616, -0.054894402623176575, 0.011156563647091389, -0.03516172245144844, 0.03545496612787247, 0.012193994596600533, -0.04747738316655159, 0.07316261529922485, 0.032250531017780304, 0.014236542396247387, -0.09600041061639786, -0.05980842560529709, 0.02772015891969204, -0.01485220342874527, 0.033500563353300095, -0.008011938072741032, -0.03570781275629997, 0.05543287470936775, -0.02325466088950634, 0.05904689058661461, -0.011384721845388412, 0.00686635822057724, -0.016855111345648766, -0.01029085274785757, -0.04840744659304619, -0.04032966122031212, 0.11308784782886505, -0.02661750465631485, 0.035826168954372406, 0.04866969585418701, 0.012983505614101887, -0.006809035316109657, -0.01160047110170126, -0.049270376563072205, 0.006547277793288231, 0.066218800842762, -0.03393424674868584, 0.03951888158917427, 0.0515170581638813, 0.05300362780690193, 0.030278466641902924, 0.07025767117738724, -0.03427630290389061, 0.04780283942818642, -0.017276987433433533, 0.008785467594861984, 0.02078084461390972, -0.05119312182068825, -0.022519389167428017, 0.03137246519327164, -0.0005895450012758374, -0.2900208532810211, 0.03755565732717514, -0.011268425732851028, 0.020030420273542404, 0.0018923331517726183, -0.008505089208483696, -0.009309704415500164, 0.02419099770486355, -0.026223663240671158, -0.0042646946385502815, 0.0031153813470155, 0.04304751381278038, 0.04307487607002258, -0.053824178874492645, -0.013519477099180222, 0.012721914798021317, 0.0544733852148056, -0.0437730997800827, 0.06728090345859528, -0.02551231160759926, -0.006223833654075861, 0.035588815808296204, 0.22199846804141998, -0.008068566210567951, -0.0013119004433974624, 0.03635761886835098, -0.01980733871459961, 0.01290980912744999, 0.06021253392100334, 0.010942786931991577, 0.056901901960372925, -0.011476507410407066, 0.08307361602783203, -0.004689532332122326, 0.013580365106463432, 0.06471648812294006, -0.05454517528414726, 0.04140545055270195, 0.012470055371522903, 0.009636796079576015, -0.02989586815237999, -0.0325237512588501, -0.04722587391734123, -0.030313124880194664, 0.09404563903808594, -0.04127880185842514, -0.03095420077443123, -0.12108567357063293, 0.028428928926587105, 0.01880452409386635, -0.09450265765190125, -0.0014188060304149985, -0.03246372193098068, -0.0027591523248702288, 0.013101729564368725, 0.030642323195934296, -0.02698049508035183, -0.028709188103675842, 0.0026545021682977676, -0.04823032394051552, -0.02585460990667343, -0.05785210058093071, -0.01446482539176941, -0.00864641647785902, 0.02969297207891941 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
``` # Create some sample data data = { "metadata": { "stockSymbol": "ABC", "exchange": "NASDAQ" }, "timestamp": datetime(2023, 9, 12, 15, 19, 48), "open": 54.80, "high": 59.20, "low": 52.60, "close": 53.50, "volume": 18000 }, { "metadata": { "stockSymbol": "ABC", "exchange": "NASDAQ" }, "timestamp": datetime(2023, 9, 12, 16, 19, 48), "open": 51.00, "high": 54.30, "low": 50.50, "close": 51.80, "volume": 12000 },
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.0354992114007473, -0.036808136850595474, 0.031020941212773323, -0.040119070559740067, 0.05749724432826042, -0.008998892270028591, 0.0002972521760966629, 0.0015459489077329636, 0.0038688776548951864, 0.0030126727651804686, -0.008437260054051876, -0.07395680993795395, 0.004956609103828669, 0.02686334028840065, 0.007797849830240011, -0.014418354257941246, -0.05359054356813431, 0.001291609019972384, -0.07207943499088287, 0.042147595435380936, 0.03043828345835209, -0.02142716385424137, -0.029476642608642578, -0.07022080570459366, 0.04581308737397194, 0.054816704243421555, 0.001260898425243795, -0.0035188463516533375, -0.03987541422247887, -0.2168162763118744, -0.016730714589357376, -0.05503036081790924, 0.057442229241132736, -0.03397494927048683, -0.0038619597908109426, -0.011178521439433098, -0.01710677519440651, 0.04428581893444061, -0.04881608113646507, 0.0789254754781723, 0.03612848371267319, -0.002925548003986478, -0.022263167425990105, -0.03446332737803459, -0.056078389286994934, -0.08188879489898682, -0.04700906202197075, -0.009057224728167057, 0.01247157622128725, 0.052192844450473785, -0.0419916994869709, -0.04882382974028587, -0.017584627494215965, -0.015345440246164799, 0.08034631609916687, 0.04712840914726257, 0.01678423024713993, 0.02956267073750496, 0.028441762551665306, 0.01793232560157776, 0.042729973793029785, 0.006655767094343901, -0.17510057985782623, 0.0720849558711052, 0.06757517158985138, 0.04249867424368858, 0.008385810069739819, -0.023854203522205353, -0.009983867406845093, -0.0005499701364897192, -0.05467627942562103, 0.02080032415688038, 0.02747821994125843, 0.05353989452123642, 0.002926661167293787, -0.03522071987390518, -0.036710530519485474, -0.0733952596783638, 0.02047937922179699, 0.04242607206106186, -0.05073521286249161, -0.048256609588861465, 0.0005315190646797419, 0.013108348473906517, -0.030819222331047058, -0.05593829229474068, 0.03875027969479561, -0.06064711511135101, 0.05308675765991211, 0.020039435476064682, -0.04790922626852989, -0.018098045140504837, -0.014872471801936626, 0.05660717934370041, -0.0689675435423851, 0.002320732455700636, 0.05092860758304596, 0.03955245763063431, -0.01822875812649727, 0.20215338468551636, -0.0746283084154129, 0.04391578957438469, 0.010912882164120674, -0.032147619873285294, 0.018314355984330177, -0.0600864440202713, -0.0345122255384922, -0.025048507377505302, 0.01972401700913906, 0.002756995614618063, -0.0025588292628526688, 0.011982479132711887, 0.017211470752954483, -0.09082455933094025, 0.0008178562275134027, 0.0013462945353239775, 0.004225138109177351, 0.0009160398622043431, -0.015213480219244957, 0.01266211923211813, 0.03675905242562294, 0.010295393876731396, 0.00881072599440813, -0.006603509187698364, 0.03517811745405197, 0.01755722239613533, 0.04359576106071472, 0.1359252780675888, 0.01991683803498745, 0.04497377574443817, 0.05807684734463692, -0.010955723002552986, -0.047441817820072174, -0.009905626997351646, -0.017178181558847427, 0.00789849553257227, -0.013040078803896904, 0.01507947314530611, 0.027012312784790993, 0.010690946131944656, -0.05645666643977165, -0.09484095126390457, -0.061991337686777115, -0.07658103853464127, 0.00988941453397274, 0.13717827200889587, -0.021794088184833527, 0.06293515115976334, -0.031060637906193733, -0.03181525692343712, -0.049735866487026215, 0.04294509440660477, -0.038389306515455246, -0.0338272750377655, -0.0004502868396230042, 0.013472705148160458, 0.07967250049114227, 0.042895350605249405, 0.0014232988469302654, -0.026768090203404427, -0.050299812108278275, -0.02266795188188553, -0.037005577236413956, 0.10802402347326279, 0.0037823605816811323, -0.09180346876382828, -0.03775622323155403, 0.027962524443864822, 0.028562337160110474, -0.03446229547262192, 0.03074132278561592, -0.00224897637963295, -0.06854021549224854, 0.004547208081930876, 0.1285574585199356, 0.008769470266997814, 0.001072841347195208, -0.011761554516851902, 0.020511001348495483, 0.0045225974172353745, 0.019541215151548386, -0.04729772359132767, -0.040896859019994736, 0.03971979394555092, 0.005445412825793028, -0.030545491725206375, -0.009378526359796524, 0.0006633555167354643, 0.002061631763353944, 0.019157830625772476, 0.015988288447260857, -0.018217751756310463, -0.036060068756341934, -0.003747686045244336, -0.06532179564237595, -0.04110647365450859, 0.00795148778706789, -0.007613396272063255, 0.014432137832045555, -0.022150063887238503, 0.08379211276769638, -0.0077779884450137615, -0.02495991252362728, 0.03311588242650032, 0.013012755662202835, 0.018117066472768784, 0.011705970391631126, -0.01677120476961136, 0.05473151430487633, -0.01758630946278572, -0.025648124516010284, 0.012596994638442993, 0.040049150586128235, -0.0023917716462165117, -0.024005461484193802, -0.01756466180086136, 0.010007030330598354, 0.009473889134824276, 0.03913529962301254, 0.06218499317765236, -0.004427274223417044, -0.10956788063049316, -0.08670511096715927, -0.2345418930053711, 0.00013007494271732867, 0.05391471087932587, 0.0024702067021280527, 0.02914103865623474, -0.007036229595541954, 0.006715711206197739, 0.01054682582616806, 0.00551915168762207, 0.09323735535144806, 0.04457719251513481, 0.014618435874581337, -0.0193245280534029, 0.01760261133313179, -0.04273281246423721, 0.020237620919942856, 0.010880731977522373, 0.0031159797217696905, -0.010372894816100597, 0.029311059042811394, -0.04362701624631882, 0.01250185165554285, -0.01720690168440342, -0.06741607934236526, 0.06814166158437729, -0.0016046747332438827, 0.2227221578359604, 0.02971755340695381, -0.005310372449457645, -0.051272738724946976, 0.09725641459226608, -0.01749059557914734, 0.0012849688064306974, -0.05645385757088661, 0.04174422845244408, 0.016572264954447746, 0.02843841351568699, 0.03148395195603371, -0.004950689151883125, -0.040454644709825516, -0.0031634534243494272, 0.016169434413313866, 0.038564685732126236, -0.0410187765955925, -0.012931494042277336, -0.06370734423398972, -0.022577667608857155, 0.01042062509804964, -0.024977318942546844, 0.03800686076283455, 0.06061201170086861, -0.006697816774249077, 0.08000292629003525, 0.00011359903146512806, -0.019576381891965866, -0.03712350130081177, -0.06509342789649963, 0.018655918538570404, -0.03119797632098198, 0.03755739703774452, 0.01679833047091961, -0.05700637400150299, 0.013848291710019112, -0.009986309334635735, 0.03192755952477455, -0.028844941407442093, -0.011567655950784683, -0.04576960951089859, -0.04157274216413498, -0.05724125728011131, -0.03557903692126274, 0.09092617779970169, -0.006161702796816826, 0.043601758778095245, 0.044773951172828674, 0.0397384837269783, -0.03665986657142639, 0.0012936375569552183, -0.02326536364853382, 0.026597369462251663, 0.03761368244886398, -0.004397409036755562, 0.04089434817433357, 0.055330920964479446, 0.06933075189590454, 0.013235433958470821, 0.05435521900653839, 0.024550143629312515, 0.03130355849862099, -0.05377664789557457, -0.009331884793937206, -0.05026329308748245, -0.04871697723865509, -0.015001832507550716, 0.017320595681667328, 0.005912757944315672, -0.2753835618495941, 0.03246554732322693, 0.011849150992929935, 0.014301139861345291, 0.015355859883129597, 0.01645519956946373, 0.008629838936030865, 0.017035268247127533, -0.024461356922984123, 0.020370332524180412, -0.02729080431163311, 0.06621327251195908, 0.04885566234588623, -0.017301445826888084, 0.0027308876160532236, 0.053754907101392746, 0.04951053857803345, -0.0545058473944664, 0.038816187530756, -0.04692806676030159, 0.043233856558799744, 0.03810654953122139, 0.2616024911403656, -0.02817699685692787, 0.02615709789097309, 0.03986218199133873, -0.018217407166957855, 0.01955091953277588, 0.08050522953271866, -0.004186572507023811, 0.04790644720196724, -0.01890384778380394, 0.10840391367673874, 0.010519132018089294, 0.012295165099203587, 0.0480937696993351, -0.06495572626590729, 0.03799492493271828, 0.01637270487844944, -0.03041667677462101, -0.0334494486451149, 0.026119625195860863, 0.00785815343260765, 0.005343463271856308, 0.09075875580310822, -0.07896993309259415, -0.017099061980843544, -0.11693836003541946, 0.039086632430553436, 0.004954067058861256, -0.08157600462436676, 0.0007492722943425179, -0.028668073937296867, -0.012713398784399033, 0.01547633484005928, 0.020964885130524635, -0.015343043953180313, -0.011824176646769047, 0.0009776372462511063, -0.01497060339897871, -0.009536915458738804, -0.08326151221990585, -0.042410582304000854, 0.030266553163528442, -0.0009690552251413465 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
{ "metadata": { "stockSymbol": "ABC", "exchange": "NASDAQ" }, "timestamp":datetime(2023, 9, 12, 17, 19, 48), "open": 52.00, "high": 53.10, "low": 50.50, "close": 52.90, "volume": 10000 }, { "metadata": { "stockSymbol": "ABC", "exchange": "NASDAQ" }, "timestamp":datetime(2023, 9, 12, 18, 19, 48), "open": 52.80, "high": 60.20, "low": 52.60, "close": 55.50, "volume": 30000 } ] # insert the data into our collection
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.014417673461139202, -0.03532514348626137, 0.025073129683732986, -0.04319912940263748, 0.0485931858420372, 0.010258624330163002, 0.006096469704061747, -0.021421127021312714, 0.022261567413806915, 0.014352455735206604, 0.015364035032689571, -0.0773848295211792, 0.006391161121428013, 0.02840600349009037, 0.024670256301760674, 0.00819668360054493, -0.0498344786465168, -0.018160011619329453, -0.08979684114456177, 0.0576985664665699, 0.06439291685819626, -0.02759021334350109, -0.02277369238436222, -0.054772354662418365, 0.05146981403231621, 0.05916699022054672, -0.0221218541264534, -0.011367020197212696, -0.06118205934762955, -0.21528476476669312, -0.008165287785232067, -0.05299894139170647, 0.0413888581097126, -0.010514778085052967, -0.005681966431438923, 0.010536160320043564, -0.016928579658269882, 0.05448386073112488, -0.03196246922016144, 0.04786413162946701, 0.038386911153793335, 0.007381837349385023, -0.037141814827919006, -0.03268732503056526, -0.05062270164489746, -0.07474622875452042, -0.04192143678665161, -0.01953578181564808, 0.01999509707093239, 0.016258371993899345, -0.020447487011551857, -0.04644748196005821, -0.01399601623415947, 0.03087628073990345, 0.02855600230395794, 0.07332202792167664, 0.05715583637356758, 0.0013288261834532022, 0.019208192825317383, 0.00959605723619461, 0.05488157272338867, 0.017232699319720268, -0.19489885866641998, 0.08339210599660873, 0.056652527302503586, 0.0499316081404686, -0.011961665004491806, -0.007642134092748165, 0.004853585734963417, -0.005683119408786297, -0.04698261618614197, -0.010476029478013515, 0.03932837024331093, 0.02097749151289463, 0.01198791153728962, -0.031034087762236595, -0.02738688513636589, -0.06041456386446953, 0.004573380574584007, 0.04033348336815834, -0.04354080557823181, -0.0602300763130188, 0.008414573967456818, -0.00022254660143516958, -0.012886140495538712, -0.044891633093357086, 0.05724203959107399, -0.07079461961984634, 0.015906458720564842, 0.02215510420501232, -0.007246722001582384, 0.0015637363540008664, -0.003769239643588662, 0.01843813806772232, -0.0850362628698349, -0.018856113776564598, 0.04395107179880142, 0.02019204944372177, -0.05858464911580086, 0.2057334929704666, -0.04143788665533066, 0.02361956238746643, 0.0007761768065392971, -0.027101818472146988, -0.0036895042285323143, -0.05566529557108879, -0.013884702697396278, -0.021360786631703377, 0.025984743610024452, 0.019513195380568504, 0.0038611472118645906, 0.011106560938060284, 0.030379395931959152, -0.058324433863162994, 0.027408240363001823, 0.004375699907541275, 0.02304711751639843, 0.0375901460647583, -0.02816595509648323, 0.008765127509832382, 0.034525707364082336, 0.020797595381736755, -0.006464893463999033, -0.01515874546021223, 0.0016910393023863435, -0.04755821451544762, 0.07156338542699814, 0.09809237718582153, 0.05154084414243698, 0.059884361922740936, 0.04923763871192932, 0.014320602640509605, -0.07743805646896362, -0.01492286752909422, -0.0033694717567414045, 0.014250999316573143, -0.005725261755287647, 0.00870961882174015, 0.040689874440431595, 0.0014256896683946252, -0.04432899132370949, -0.09088598191738129, -0.07111602276563644, -0.10489139705896378, -0.011642837896943092, 0.15866000950336456, -0.03324069827795029, 0.05853032320737839, -0.05140472203493118, -0.04639715328812599, -0.049223076552152634, 0.05099720135331154, -0.03374504670500755, -0.0036581873428076506, -0.002758426358923316, -0.0057693962007761, 0.0615205243229866, 0.044448114931583405, -0.009421003051102161, -0.0014088315656408668, -0.040584396570920944, -0.036280229687690735, -0.040296755731105804, 0.09790519624948502, 0.03210918605327606, -0.08888401836156845, -0.041861534118652344, 0.020290782675147057, 0.03706589341163635, -0.043395500630140305, 0.01865941844880581, 0.045634374022483826, -0.06234826147556305, 0.02959856204688549, 0.15079054236412048, 0.040329039096832275, 0.027165569365024567, -0.02239270694553852, 0.00566428666934371, -0.029320644214749336, 0.0065908171236515045, -0.04299107566475868, -0.03883494436740875, 0.04850416257977486, 0.02550629898905754, -0.048113323748111725, -0.010665437206625938, -0.024537576362490654, 0.034978944808244705, 0.04657960310578346, 0.006520066875964403, -0.017389889806509018, -0.038125813007354736, 0.04894644021987915, -0.05373649671673775, -0.059506822377443314, 0.016641197726130486, -0.00831659883260727, 0.017215296626091003, -0.03453179821372032, 0.09452551603317261, 0.001432130578905344, -0.0307987779378891, 0.03572632372379303, 0.04786643013358116, 0.015433276072144508, -0.006780935451388359, -0.02636958286166191, 0.03078082948923111, -0.043387096375226974, -0.038000598549842834, 0.020696941763162613, 0.04441319406032562, 0.00024788870359770954, -0.00981355644762516, 0.004536430351436138, 0.03138791769742966, 0.034162942320108414, 0.07492998242378235, 0.06083186715841293, -0.007589743472635746, -0.08058611303567886, -0.022748110815882683, -0.2292277067899704, 0.021723249927163124, 0.01631969027221203, 0.00555937085300684, -0.0014961996348574758, -0.028382565826177597, 0.00830336194485426, -0.02155563235282898, -0.010145082138478756, 0.07620018720626831, 0.04047861695289612, -0.0028956751339137554, -0.018087921664118767, 0.009837158024311066, -0.02519632689654827, 0.024916788563132286, 0.006442678160965443, 0.00695640966296196, -0.028216075152158737, 0.037111036479473114, -0.04106903821229935, 0.023172058165073395, -0.05199567601084709, -0.04430112987756729, 0.07815521955490112, 0.013381889089941978, 0.1972864270210266, 0.026187950745224953, -0.04799332097172737, -0.041076887398958206, 0.05195547640323639, -0.004135266412049532, -0.02685203030705452, -0.04707813635468483, 0.02430851384997368, 0.007467841729521751, 0.04344585910439491, 0.01429166179150343, -0.02543780766427517, -0.041362058371305466, -0.05338364467024803, 0.02932191826403141, 0.01790434494614601, -0.06508303433656693, 0.008696561679244041, -0.027778854593634605, -0.03061799518764019, 0.012014636769890785, -0.052893586456775665, 0.01536463387310505, 0.044868480414152145, -0.00905932579189539, 0.06753823161125183, 0.018590301275253296, -0.0073749530129134655, -0.05809222534298897, -0.06989393383264542, 0.049554336816072464, -0.02639678120613098, 0.06156659498810768, -0.015161496587097645, -0.03480568900704384, 0.03839505463838577, -0.03049171343445778, 0.03944374620914459, -0.036119960248470306, -0.003974078688770533, -0.020380748435854912, -0.020928140729665756, -0.04824212193489075, -0.02919379435479641, 0.04838862270116806, -0.014128551818430424, 0.0768304392695427, 0.07633280754089355, 0.04899664595723152, -0.03285985440015793, 0.015906203538179398, -0.01053159311413765, 0.029355915263295174, 0.045233163982629776, -0.026027703657746315, 0.06483477354049683, 0.07406578212976456, 0.07217755913734436, 0.0414532870054245, 0.06131332740187645, 0.0008616639534011483, -0.0005382978706620634, -0.025633830577135086, -0.0049818772822618484, -0.04286875203251839, -0.05893383547663689, -0.018963661044836044, -0.012700303457677364, 0.005083386320620775, -0.2805422246456146, 0.03700624406337738, 0.0027393181808292866, -0.014807862229645252, 0.013637905940413475, 0.011076617054641247, 0.006697152275592089, 0.0019297554390504956, -0.005747945047914982, 0.0215790756046772, -0.0188264362514019, 0.057223040610551834, 0.024183064699172974, -0.029765455052256584, -0.006751004606485367, 0.03411365672945976, 0.031870972365140915, -0.049574755132198334, 0.04267265647649765, -0.048613958060741425, 0.02680063061416149, 0.045606452971696854, 0.27208173274993896, 0.009769232012331486, -0.008187202736735344, 0.020496532320976257, -0.004365830682218075, 0.0226401686668396, 0.0712447240948677, -0.004552273079752922, 0.04448487609624863, -0.006970233749598265, 0.09052026271820068, 0.029170837253332138, 0.01733005791902542, 0.001669848570600152, -0.08663079142570496, 0.031027011573314667, 0.0366278737783432, 0.0021918772254139185, -0.07532167434692383, -0.010403551161289215, -0.00941686611622572, 0.01575007103383541, 0.08676697313785553, -0.08781091123819351, -0.013943033292889595, -0.08572254329919815, 0.030847948044538498, 0.015708671882748604, -0.06238985434174538, -0.034771233797073364, -0.021718809381127357, -0.006147859618067741, 0.00403647730126977, 0.016702571883797646, -0.03218163549900055, -0.0236933846026659, -0.04482158273458481, -0.013205744326114655, -0.010341272689402103, -0.0630510002374649, -0.040543608367443085, 0.01386722456663847, 0.029976777732372284 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
# insert the data into our collection collection.insert_many(data) ``` Now, let’s run a find query on our collection to retrieve data at a specific timestamp. Run this query in the Jupyter Notebook after the previous script. ``` collection.find_one({'timestamp': datetime(2023, 9, 12, 15, 19, 48)}) ``` //OUTPUT ![Output of find_one() command As you can see from the output, we were able to query our time-series collection and retrieve data points at a specific timestamp. Similarly, you can run more powerful queries on your time-series collection by using the aggregation pipeline. For the scope of this tutorial, we won’t be covering that. But, if you want to learn more about it, here is where you can go:
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.025767987594008446, -0.013252289965748787, 0.029701393097639084, -0.05221915617585182, 0.0028829695656895638, -0.00946586299687624, 0.009364370256662369, -0.023838480934500694, 0.05999794602394104, 0.016339341178536415, 0.022351693361997604, -0.08539100736379623, 0.02368733659386635, 0.02574850618839264, -0.022210460156202316, -0.011330022476613522, -0.05863852798938751, -0.016624804586172104, -0.07031133770942688, 0.026663856580853462, 0.01167814526706934, -0.024315522983670235, -0.03799235820770264, -0.06316853314638138, 0.04014581814408302, 0.04297740012407303, -0.008026815950870514, -0.0448111854493618, -0.05508149042725563, -0.24546398222446442, 0.02517629787325859, -0.05785578489303589, 0.04470445588231087, -0.010824980214238167, 0.0019285058369860053, 0.021182777360081673, 0.008011152036488056, 0.06964262574911118, -0.020673681050539017, 0.07130356132984161, 0.05451780930161476, -0.02924029715359211, -0.05175233259797096, -0.03556389361619949, -0.058630675077438354, -0.05291970819234848, -0.015245899558067322, -0.0375751331448555, 0.05016900971531868, -0.03527069836854935, -0.019878555089235306, -0.016255317255854607, 0.011917981319129467, 0.015189861878752708, 0.009637920185923576, 0.040763236582279205, 0.09030097723007202, 0.028626205399632454, 0.009244539774954319, -0.019717248156666756, 0.03782615810632706, 0.03144725784659386, -0.18380877375602722, 0.0908500924706459, 0.025454604998230934, 0.045393332839012146, 0.004337511956691742, -0.002160806441679597, 0.0186228659003973, 0.04250897467136383, -0.044235266745090485, -0.006223149131983519, 0.010790904052555561, 0.03966068476438522, 0.02140827849507332, -0.0188544150441885, -0.010889250785112381, -0.04721689596772194, 0.0014338725013658404, 0.03946976736187935, -0.05875431001186371, -0.021611593663692474, -0.007879025302827358, -0.0003343445132486522, -0.005860446952283382, -0.042581669986248016, 0.05779249966144562, -0.033183690160512924, 0.02877606824040413, 0.03205631300806999, -0.029806412756443024, 0.0019153753528371453, -0.01563958078622818, 0.07008714973926544, -0.0737447440624237, -0.03233062103390694, 0.06303086876869202, 0.04439191892743111, -0.010232537053525448, 0.2141667753458023, -0.05630606412887573, 0.04731899872422218, 0.0022439006716012955, 0.009937935508787632, -0.010933225043118, -0.06605655699968338, -0.027435949072241783, -0.05880241096019745, -0.010634910315275192, -0.005420721601694822, 0.007075900211930275, -0.006403992418199778, 0.05693325772881508, -0.07628878951072693, 0.04908617585897446, 0.007113664411008358, 0.03050820156931877, 0.005599671974778175, -0.0421549528837204, 0.029262227937579155, 0.009396255016326904, 0.04127794876694679, 0.03720400109887123, -0.007107372395694256, 0.013947437517344952, 0.00026060163509100676, 0.07020121812820435, 0.08805833756923676, -0.0009442942100577056, -0.0010414288844913244, 0.020962480455636978, 0.015628181397914886, -0.11347533017396927, 0.005167249124497175, 0.0045045362785458565, 0.03098154440522194, -0.015109365805983543, 0.0015299973310902715, 0.06883008033037186, -0.055765967816114426, -0.048322901129722595, -0.0945008397102356, -0.004653461277484894, -0.09679190814495087, -0.034600768238306046, 0.15490664541721344, 0.00994834303855896, 0.03272637352347374, -0.07620972394943237, -0.04616245999932289, -0.08438995480537415, 0.027750873938202858, -0.025817856192588806, -0.013017036020755768, 0.02128668874502182, 0.05877504497766495, 0.084409199655056, 0.06892892718315125, -0.034925442188978195, 0.008750011213123798, -0.09056033939123154, -0.029956689104437828, -0.026882637292146683, 0.0957370400428772, 0.005863024387508631, -0.15799610316753387, -0.018325500190258026, -0.007522383239120245, 0.0009901599260047078, -0.04698757827281952, 0.048580486327409744, 0.01724705658853054, -0.03561623394489288, 0.04162617772817612, 0.12220185995101929, 0.039207957684993744, -0.034631598740816116, 0.028992589563131332, 0.020630575716495514, -0.014255130663514137, 0.014750317670404911, -0.009659653529524803, 0.015045310370624065, 0.03569509834051132, 0.034608785063028336, -0.06241137161850929, -0.0049365186132490635, -0.038103703409433365, 0.02565830759704113, 0.04900645464658737, -0.019134070724248886, -0.011566568166017532, -0.006237159948796034, -0.013609196059405804, -0.04039671644568443, -0.04819342866539955, -0.01439178641885519, 0.022283002734184265, 0.035085391253232956, -0.03829842060804367, 0.0393097810447216, -0.025242317467927933, -0.0092856977134943, 0.03566834330558777, 0.012895752675831318, 0.0006729126907885075, -0.031666722148656845, -0.019006799906492233, 0.06179143115878105, -0.05321020632982254, -0.029180800542235374, 0.00848774891346693, 0.044897086918354034, -0.027743853628635406, -0.046467989683151245, 0.02522881142795086, 0.02409846894443035, 0.025901028886437416, 0.07135471701622009, 0.026541298255324364, -0.01243850402534008, -0.0884123146533966, -0.003054201602935791, -0.2325386106967926, 0.01118316687643528, 0.002601488260552287, 0.04104619845747948, 0.012064317241311073, -0.0492735281586647, 0.01071165781468153, -0.01335127092897892, 0.0015814665239304304, 0.06833051145076752, 0.036855604499578476, -0.012446216307580471, -0.01888328790664673, -0.00416830787435174, -0.03351517394185066, 0.0566464364528656, -0.004064565524458885, 0.00716948788613081, -0.0439370721578598, 0.02157892845571041, -0.026792900636792183, 0.0039689261466264725, -0.030382124707102776, -0.045559659600257874, 0.05711330473423004, -0.015233471058309078, 0.20488640666007996, 0.043031252920627594, -0.027591455727815628, -0.02773236483335495, 0.06202356517314911, -0.011589175090193748, -0.061916038393974304, -0.07211832702159882, 0.021455418318510056, 0.01560620591044426, 0.044888317584991455, 0.010934400372207165, -0.010800626128911972, -0.049775950610637665, -0.029459012672305107, 0.05154982954263687, 0.01553881261497736, -0.06137453392148018, -0.023000163957476616, 0.004395774565637112, 0.0020093603525310755, -0.0217145849019289, -0.05308648571372032, 0.025177977979183197, 0.03244413062930107, -0.008333072066307068, 0.04888041689991951, 0.02918059565126896, -0.017081933096051216, -0.055542271584272385, -0.05388341844081879, 0.06302472949028015, -0.021272964775562286, 0.0857381820678711, 0.007500463631004095, -0.009608928114175797, 0.03728479892015457, -0.04801998659968376, 0.07099790871143341, -0.06949835270643234, -0.0030645483639091253, -0.018322806805372238, 0.01382975373417139, -0.0704110711812973, -0.011885886080563068, 0.05707252770662308, -0.04316844791173935, 0.02878502570092678, 0.04924575611948967, 0.027560321614146233, 0.002536719897761941, 0.008400325663387775, -0.013513785786926746, -0.024533240124583244, 0.03580697625875473, -0.048842694610357285, 0.05654868111014366, 0.06597135961055756, 0.05166120082139969, 0.010128752328455448, 0.04235031083226204, 0.03327276557683945, 0.02949269860982895, -0.02969779074192047, -0.04416514188051224, -0.04571405053138733, -0.03000124916434288, 0.004186457954347134, 0.02356073260307312, 0.015085088089108467, -0.2794421315193176, 0.05639040470123291, -0.02802560105919838, 0.013486085459589958, 0.004914149641990662, -0.0000713175832061097, 0.0033699627965688705, 0.0335785374045372, -0.005610003136098385, 0.0022239035461097956, 0.02173289842903614, 0.05587797611951828, 0.02683187648653984, -0.0032421026844531298, -0.011786402203142643, 0.03274363651871681, 0.03905610367655754, -0.04380546882748604, 0.01912342570722103, -0.04396993666887283, 0.05828933045268059, 0.06837501376867294, 0.22607120871543884, 0.026946891099214554, 0.025178799405694008, 0.03021710366010666, 0.011398976668715477, -0.02460099570453167, 0.021421516314148903, 0.006902758963406086, 0.018121786415576935, -0.01882203482091427, 0.06914328783750534, -0.018579749390482903, 0.007853335700929165, 0.04574989899992943, -0.0641067624092102, 0.033603064715862274, 0.034214530140161514, -0.025413768365979195, -0.05615084990859032, 0.00997923593968153, -0.05432241037487984, -0.0038280123844742775, 0.08537998795509338, -0.024350536987185478, -0.05037793517112732, -0.07387901842594147, -0.025143111124634743, 0.03520089387893677, -0.04620202258229256, -0.0034938924945890903, -0.0057850065641105175, 0.014380781911313534, 0.04782745987176895, 0.04905553534626961, -0.023422176018357277, 0.017187602818012238, 0.0024596203584223986, -0.019205346703529358, -0.008352943696081638, -0.05995035544037819, 0.017896758392453194, -0.0017102847341448069, 0.027861259877681732 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
1. MongoDB Aggregation Learning Byte 2. MongoDB Aggregation in Python Learning Byte 3. MongoDB Aggregation Documentation 4. Practical MongoDB Aggregation Book ## Analyzing the data with a pandas DataFrame Now, let’s see how you can move your time-series data into pandas DataFrame to run some analytics operations. MongoDB has built a tool just for this purpose called PyMongoArrow. PyMongoArrow is a Python library that lets you move data in and out of MongoDB into other data formats such as pandas DataFrame, Numpy array, and Arrow Table. Let’s quickly install PyMongoArrow using the pip command in your terminal. We are assuming that you already have pandas installed on your system. If not, you can use the pip command to install it too. ``` pip install pymongoarrow ```
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.04088534787297249, -0.05206771939992905, 0.0020554903894662857, -0.017960892990231514, 0.058068353682756424, -0.021622950211167336, 0.0023880628868937492, 0.006660361308604479, 0.0019726513419300318, 0.034535232931375504, 0.017797740176320076, -0.1180969774723053, 0.04280159994959831, -0.0009599205222912133, -0.023985302075743675, -0.005183670204132795, -0.034808285534381866, 0.0124112693592906, -0.05763411521911621, 0.01964283362030983, -0.008490155450999737, -0.01935860887169838, -0.056721050292253494, -0.0326627716422081, 0.0508047454059124, 0.0721944272518158, 0.014849036000669003, -0.04024214297533035, -0.06086089089512825, -0.2158876210451126, -0.010029207915067673, -0.03507274389266968, 0.044821761548519135, -0.057577647268772125, 0.0324590764939785, 0.005523288622498512, -0.0017945802537724376, 0.03479097783565521, -0.01512196660041809, 0.051007356494665146, 0.03998634219169617, -0.00432825880125165, -0.041664812713861465, -0.05884862691164017, -0.04575057700276375, -0.07743003964424133, -0.004132475238293409, -0.032806333154439926, 0.012988933362066746, -0.03345557674765587, -0.010786708444356918, -0.014267295598983765, 0.0020907737780362368, 0.025234729051589966, 0.047268837690353394, 0.054525937885046005, 0.04127258434891701, 0.009557199664413929, 0.013680268079042435, -0.010461144149303436, 0.06325893104076385, 0.006483846344053745, -0.17696599662303925, 0.11795208603143692, 0.05634073168039322, 0.06541875004768372, -0.016854193061590195, -0.013282204046845436, 0.04479408264160156, 0.04842671379446983, -0.047275129705667496, -0.00046282538096420467, 0.011899096891283989, 0.040916807949543, 0.00670742429792881, -0.03281620144844055, -0.006864316761493683, -0.06336194276809692, 0.002856109058484435, 0.03406490385532379, -0.05958952754735947, -0.020455026999115944, -0.042934488505125046, -0.0027118574362248182, 0.008244938217103481, -0.030161738395690918, 0.030774828046560287, -0.04340581223368645, -0.00042369100265204906, 0.0014392576413229108, 0.0021163769997656345, -0.013414474204182625, -0.0002926487650256604, 0.054422520101070404, -0.0443757139146328, 0.00012669755960814655, 0.05338294431567192, 0.04214869439601898, 0.029854850843548775, 0.23107506334781647, -0.043485596776008606, 0.02726033702492714, -0.03876711055636406, -0.011810289695858955, 0.05290527641773224, -0.057774387300014496, 0.007769154850393534, -0.05907810851931572, 0.0070842113345861435, -0.007997816428542137, -0.017550254240632057, -0.02006315253674984, 0.037360429763793945, -0.08802302181720734, 0.04237396642565727, 0.0036004444118589163, -0.021490678191184998, 0.03216385468840599, -0.04904676601290703, 0.024871813133358955, -0.005107933189719915, 0.011797199957072735, 0.06125727295875549, -0.006181157194077969, 0.028881186619400978, -0.03129925578832626, 0.02959098108112812, 0.1004733294248581, 0.014028796926140785, 0.013422000221908092, 0.02699851803481579, -0.022040117532014847, -0.09383265674114227, -0.0209267009049654, 0.02578447386622429, 0.010858839377760887, -0.00572972884401679, 0.014313086867332458, 0.030513685196638107, 0.026930471882224083, -0.025202305987477303, -0.07905266433954239, -0.015170085243880749, -0.07166805118322372, -0.0374438613653183, 0.16224338114261627, -0.01283958274871111, 0.09101095795631409, -0.04230585694313049, -0.02232278883457184, -0.009281796403229237, 0.0333319790661335, -0.02875635214149952, -0.04343297705054283, 0.018453817814588547, 0.05080883204936981, 0.08017481863498688, 0.09637146443128586, -0.033456068485975266, -0.02939203381538391, -0.0541197694838047, -0.029676776379346848, -0.022077133879065514, 0.07788814604282379, -0.01064682099968195, -0.13382461667060852, -0.005657683592289686, 0.007492975331842899, -0.010607275180518627, -0.05334826558828354, 0.02253042906522751, 0.04071394354104996, -0.06652230769395828, 0.04427371174097061, 0.10569963604211807, -0.0003193065640516579, -0.0282808318734169, -0.004525013267993927, 0.06254029273986816, -0.007425118237733841, 0.024584662169218063, -0.038580942898988724, -0.04332364350557327, 0.01089281216263771, 0.02553846314549446, -0.04820069670677185, -0.008780894801020622, -0.02797154150903225, 0.028486289083957672, 0.03982008993625641, -0.0015589797403663397, 0.0033536311239004135, 0.0010938706109300256, 0.012968852184712887, -0.0233784019947052, -0.05423813313245773, -0.008434471674263477, -0.0237253550440073, 0.00497464882209897, -0.0558990053832531, 0.05301279202103615, 0.011999585665762424, -0.015610946342349052, 0.018700353801250458, 0.03014855645596981, 0.008412466384470463, -0.018323780968785286, -0.001587622449733317, 0.06370314210653305, -0.01512764673680067, -0.019807610660791397, -0.018207987770438194, 0.027639634907245636, -0.026461435481905937, -0.024308206513524055, -0.018920207396149635, 0.01222161017358303, 0.02566935122013092, 0.012845681048929691, 0.04195328801870346, 0.0023325395304709673, -0.08365624397993088, -0.03707661107182503, -0.24903711676597595, 0.004610261879861355, 0.026141436770558357, 0.027382705360651016, 0.027304934337735176, -0.06527437269687653, 0.02403218112885952, -0.008829696103930473, -0.00531899044290185, 0.09054963290691376, 0.06704378873109818, -0.01442280039191246, 0.004211418330669403, -0.00149357202462852, -0.03708091750741005, 0.07236653566360474, -0.0015678826021030545, 0.0392192080616951, -0.05479242280125618, 0.00827064923942089, -0.012353984639048576, 0.01812932640314102, -0.03875932842493057, -0.051003918051719666, 0.02727099321782589, 0.015240264125168324, 0.18930676579475403, 0.010216452181339264, 0.010777254588901997, -0.06353238224983215, 0.03656793385744095, -0.005063263699412346, -0.06833189725875854, -0.10524963587522507, 0.06095798686146736, 0.015497936867177486, 0.032293323427438736, 0.0023364087101072073, -0.04036179557442665, -0.02702910080552101, -0.022400006651878357, 0.034441594034433365, 0.04912569746375084, -0.08222315460443497, -0.012493825517594814, -0.01676100306212902, -0.014055635780096054, 0.005635051056742668, -0.024639952927827835, 0.008744251914322376, 0.014913203194737434, 0.02071009948849678, 0.061041273176670074, 0.012867060489952564, -0.012242920696735382, -0.022652465850114822, -0.07574150711297989, 0.059984855353832245, -0.03851405903697014, 0.03737534210085869, 0.012509814463555813, -0.05828382819890976, 0.03331400081515312, -0.014570262283086777, 0.040248241275548935, -0.01345005538314581, -0.002935372991487384, -0.015644237399101257, 0.030882304534316063, -0.03794770687818527, -0.026949280872941017, 0.10177528113126755, -0.03185494244098663, 0.005271110218018293, 0.038284167647361755, 0.048730917274951935, 0.006225258577615023, 0.0036638998426496983, -0.04958432540297508, -0.03820374235510826, 0.06335631757974625, -0.040766820311546326, 0.03195953741669655, 0.0573611706495285, 0.06351227313280106, -0.009693329222500324, 0.05429205670952797, -0.02388123981654644, 0.022975655272603035, -0.029586564749479294, -0.019564330577850342, -0.011816280893981457, -0.04921126365661621, -0.02042377181351185, 0.016908472403883934, 0.0508023202419281, -0.28773221373558044, 0.04768810048699379, -0.04445357620716095, 0.017856290563941002, 0.03385221213102341, 0.011865590699017048, 0.04667532071471214, 0.012244017794728279, -0.023753473535180092, 0.02866680547595024, -0.008585016243159771, 0.0261120293289423, 0.04056696221232414, -0.024196604266762733, -0.00677303085103631, 0.05967563018202782, 0.06691128015518188, -0.026356734335422516, -0.0008905893773771822, -0.020389540120959282, 0.037888601422309875, 0.03364703059196472, 0.24472860991954803, 0.005886928178369999, 0.019008757546544075, 0.003572855843231082, -0.008290987461805344, 0.01618027128279209, 0.047103364020586014, 0.023107819259166718, 0.01994507946074009, -0.022377843037247658, 0.06653803586959839, -0.028331588953733444, 0.0336705707013607, 0.054966554045677185, -0.06433901190757751, 0.025761645287275314, 0.01198827475309372, -0.024597255513072014, -0.014775272458791733, -0.0023910696618258953, -0.035581089556217194, 0.005748246796429157, 0.09711745381355286, -0.016212590038776398, -0.04044260457158089, -0.1214839369058609, 0.016017135232686996, 0.03980398550629616, -0.05684065818786621, -0.016915664076805115, -0.03823572397232056, -0.002215989865362644, 0.022748876363039017, 0.049781255424022675, -0.0006003340240567923, -0.000048492340283701196, 0.0004584600683301687, -0.04466705396771431, 0.03707192465662956, -0.10862989723682404, -0.00292462226934731, 0.03411155939102173, 0.015766283497214317 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
``` pip install pymongoarrow ``` Now, let’s import all the necessary libraries. We are going to be using the same file or notebook (Jupyter Notebook) to run the codes below. ``` import pymongoarrow import pandas as pd # pymongoarrow.monkey module provided an interface to patch pymongo, in place, and add pymongoarrow's functionality directly to collection instance. from pymongoarrow.monkey import patch_all patch_all() # Let's use the pymongoarrow's find_pandas_all() function to read MongoDB query result sets into df = collection.find_pandas_all({}) ``` Now, we have read all of our stock data stored in the “stocks” collection into a pandas DataFrame ‘df’. Let’s quickly print the value stored in the ‘df’ variable to verify it. ``` print(df) print(type(df)) ``` //OUTPUT
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.05467776581645012, 0.0006805703742429614, 0.017405429854989052, -0.025892961770296097, 0.03629424050450325, -0.02561277151107788, -0.016510091722011566, 0.0070707653649151325, -0.00209377845749259, 0.03828689083456993, 0.029631977900862694, -0.10912544280290604, 0.040215276181697845, -0.01818256266415119, -0.017094068229198456, 0.006693254690617323, -0.024727649986743927, -0.0019454467110335827, -0.07231132686138153, 0.003547936910763383, -0.04248516634106636, -0.030721668154001236, -0.056614309549331665, -0.022820692509412766, 0.042786624282598495, 0.07605257630348206, 0.014566863887012005, -0.031290456652641296, -0.025565728545188904, -0.2275301218032837, -0.010563654825091362, -0.05943659693002701, 0.011642714031040668, -0.023625101894140244, 0.03766094893217087, 0.0004403607454150915, 0.02006114460527897, 0.02512446790933609, 0.03309701383113861, 0.0492667555809021, 0.02117936871945858, -0.013646377250552177, -0.038460783660411835, -0.06188228726387024, -0.03835485875606537, -0.06869906932115555, -0.02082551270723343, -0.023525794968008995, 0.03322635963559151, -0.049187883734703064, -0.011041383258998394, -0.014999684877693653, -0.009398902766406536, 0.0009386177407577634, -0.01880977489054203, 0.03350139409303665, 0.05864182859659195, 0.0617235042154789, 0.013846349902451038, -0.004126031417399645, 0.0453668087720871, 0.02776632271707058, -0.206665500998497, 0.1107855811715126, 0.043123047798871994, 0.04082581773400307, -0.038662802428007126, -0.033297766000032425, 0.07658794522285461, 0.051910948008298874, -0.06561455875635147, 0.02455737441778183, 0.017174607142806053, 0.03957787901163101, -0.00428494717925787, -0.03907516598701477, -0.010728821158409119, -0.04289279505610466, 0.0024468961637467146, 0.028789177536964417, -0.04731205105781555, -0.02175133116543293, -0.031949613243341446, -0.010616437532007694, 0.00963121373206377, 0.008528601378202438, 0.027021165937185287, 0.002023426815867424, 0.021903017535805702, 0.013764654286205769, 0.01965026557445526, -0.013673483394086361, 0.02362360619008541, 0.04621684551239014, -0.03224080055952072, 0.02416589856147766, 0.04638667404651642, 0.015069839544594288, -0.004187615588307381, 0.23402133584022522, -0.02095126174390316, 0.01999647170305252, -0.03029133379459381, 0.005517291370779276, 0.041172802448272705, -0.038418374955654144, -0.01034538634121418, -0.043742816895246506, -0.003433570498600602, -0.03804457187652588, -0.010067456401884556, -0.023303436115384102, 0.07406312972307205, -0.06463344395160675, 0.027067767456173897, -0.012690669856965542, -0.03081115335226059, 0.006049336865544319, -0.05135497823357582, 0.034965500235557556, -0.009529868140816689, -0.000146534715895541, 0.04248493164777756, 0.002639851998537779, 0.019672665745019913, 0.014555772766470909, 0.03054378740489483, 0.09777341783046722, 0.01754368096590042, 0.021508732810616493, -0.0034377931151539087, -0.03045564331114292, -0.05156758427619934, -0.03724990785121918, 0.0026343988720327616, -0.0033596225548535585, -0.0035800524055957794, 0.015109509229660034, 0.048204533755779266, -0.010048127733170986, -0.07722257077693939, -0.08448675274848938, -0.02889324352145195, -0.04840004816651344, -0.03423469141125679, 0.10584486275911331, -0.022037925198674202, 0.08833417296409607, -0.0609394796192646, -0.001071420032531023, 0.004553445149213076, 0.024144621565937996, -0.03324441611766815, -0.024344036355614662, 0.02014935575425625, 0.019271571189165115, 0.08516097813844681, 0.0870341956615448, -0.03212188184261322, -0.038393665105104446, -0.030340490862727165, -0.03719346970319748, -0.07639401406049728, 0.06070369482040405, -0.019344575703144073, -0.08888186514377594, -0.011919397860765457, -0.020729389041662216, 0.0020781010389328003, -0.03927145525813103, 0.017497144639492035, 0.04069694131612778, -0.0708874836564064, 0.030383655801415443, 0.06729798763990402, 0.005331008695065975, -0.05185776948928833, 0.004946824163198471, 0.033229418098926544, 0.015263724140822887, 0.007419860456138849, -0.032007452100515366, -0.006848878227174282, -0.030288996174931526, 0.024184681475162506, -0.07541264593601227, -0.007085174787789583, -0.025162719190120697, 0.049763258546590805, 0.018153397366404533, 0.0332212969660759, 0.01743006519973278, 0.039030496031045914, -0.047687046229839325, -0.0440635122358799, -0.04306968301534653, -0.024429982528090477, -0.013813585974276066, -0.00041200098348781466, -0.03056023269891739, 0.08018560707569122, 0.0281648188829422, -0.020792776718735695, 0.007767201866954565, -0.0036902788560837507, 0.01727851666510105, -0.048728086054325104, -0.034369103610515594, 0.07754720747470856, -0.014621236361563206, -0.04981362447142601, 0.022181373089551926, 0.05473106727004051, 0.0028017789591103792, -0.029607122763991356, 0.00012149365647928789, 0.001492567011155188, 0.029778022319078445, 0.04552256315946579, 0.040599189698696136, -0.002188613172620535, -0.10043016821146011, -0.04061863198876381, -0.2451840043067932, 0.008694842457771301, 0.021964333951473236, 0.024335645139217377, -0.003159558167681098, -0.08050765097141266, 0.024641431868076324, 0.0026119828689843416, -0.009152494370937347, 0.10158119350671768, 0.09428855776786804, 0.0011665781494230032, 0.008495721966028214, 0.04012081399559975, -0.0070975953713059425, 0.04754819720983505, 0.041364412754774094, 0.041552431881427765, -0.03366916626691818, 0.016340425238013268, -0.020671896636486053, 0.005534728057682514, -0.05051463469862938, -0.04272431880235672, 0.031557440757751465, -0.012158812023699284, 0.2204725444316864, 0.06713657081127167, 0.016872333362698555, -0.03887798637151718, 0.0303787924349308, -0.012545162811875343, -0.057475924491882324, -0.14265120029449463, 0.06210014224052429, 0.028105318546295166, 0.021485241129994392, 0.03894218057394028, -0.02985025942325592, 0.009161005727946758, -0.0037164990790188313, 0.053408779203891754, 0.019217031076550484, -0.08128935843706131, 0.0034175333566963673, -0.02924557775259018, -0.027048252522945404, -0.01384770032018423, -0.04483574256300926, 0.019107487052679062, 0.028671231120824814, 0.034758634865283966, 0.05681643262505531, 0.0003936428693123162, -0.011689865961670876, -0.023697638884186745, -0.04212420433759689, 0.05153165012598038, -0.04977654665708542, 0.037329770624637604, -0.005147876217961311, -0.031190751120448112, 0.03507249429821968, -0.016577253118157387, 0.006683484185487032, -0.012727797031402588, 0.016738364472985268, -0.04732935130596161, 0.08280468732118607, 0.002276917453855276, -0.021397678181529045, 0.0632706880569458, -0.02992282062768936, 0.0399322547018528, 0.01733381301164627, 0.04913945868611336, 0.010806984268128872, 0.004709589760750532, -0.0412793830037117, -0.028079209849238396, 0.10698582231998444, -0.02742689475417137, -0.0037789111956954002, 0.04985102638602257, 0.05547310784459114, -0.008422046899795532, 0.035411953926086426, -0.016033554449677467, 0.027632806450128555, -0.013500903733074665, -0.03051452338695526, -0.02796279825270176, -0.04796207323670387, 0.006573261693120003, 0.07092570513486862, 0.04928620532155037, -0.29160451889038086, 0.023829011246562004, -0.011553817428648472, -0.021082796156406403, 0.008462744764983654, 0.010522517375648022, 0.0423484742641449, 0.013905570842325687, -0.016981912776827812, 0.029223168268799782, 0.03438065946102142, 0.0003030558582395315, 0.0018650919664651155, -0.004378850106149912, -0.008902319706976414, 0.039238449186086655, 0.08323877304792404, -0.021055757999420166, 0.03755766525864601, -0.02233257330954075, 0.057852406054735184, 0.03084922954440117, 0.20800107717514038, -0.03512054309248924, 0.0029068884905427694, 0.043342914432287216, -0.0028345268219709396, 0.002697734395042062, 0.034062858670949936, 0.011422406882047653, 0.0271278265863657, -0.04227123782038689, 0.04305288568139076, -0.04704519361257553, 0.029032088816165924, 0.07764512300491333, -0.06031627580523491, 0.029883647337555885, 0.04918494448065758, -0.04305991530418396, -0.023300303146243095, 0.014238529838621616, -0.06063457950949669, -0.03117048740386963, 0.08684840798377991, -0.03001057729125023, -0.0700085386633873, -0.0928909033536911, 0.01215775404125452, 0.020595837384462357, -0.04931739717721939, -0.029815293848514557, -0.013750380836427212, -0.011712024919688702, 0.021984564140439034, 0.044149406254291534, 0.0030850996263325214, 0.0061529031954705715, -0.0028124807868152857, -0.04371275752782822, 0.05583692342042923, -0.11720828711986542, 0.05350741371512413, 0.03395373374223709, 0.008045744150876999 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
``` print(df) print(type(df)) ``` //OUTPUT Hurray…congratulations! As you can see, we have successfully read our MongoDB data into pandas DataFrame. Now, if you are a stock market trader, you would be interested in doing a lot of analysis on this data to get meaningful insights. But for this tutorial, we are just going to calculate the hourly percentage change in the closing prices of the stock. This will help us understand the daily price movements in terms of percentage gains or losses. We will add a new column in our ‘df’ DataFrame called “daily_pct_change”. ``` df = df.sort_values('timestamp') df'daily_pct_change'] = df['close'].pct_change() * 100 # print the dataframe to see the modified data print(df) ``` //OUTPUT ![Output of modified DataFrame
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.035437993705272675, -0.030191706493496895, 0.025402601808309555, 0.00815054401755333, 0.06877458840608597, -0.014922619797289371, 0.02516753226518631, 0.02115354686975479, 0.03495802357792854, 0.0010031373240053654, 0.03473891317844391, -0.07995058596134186, 0.023258473724126816, 0.03792057931423187, -0.03266521543264389, -0.00244585401378572, -0.029275022447109222, -0.019015002995729446, -0.09722093492746353, 0.01912015676498413, 0.007813017815351486, -0.04890530928969383, -0.0536467581987381, -0.058361370116472244, 0.06314017623662949, 0.06428002566099167, -0.012577665969729424, -0.01712304912507534, -0.04519746080040932, -0.20029029250144958, 0.019815480336546898, -0.061501968652009964, 0.05051117390394211, -0.07078132778406143, 0.00627151457592845, -0.020215291529893875, -0.03996630012989044, 0.017041580751538277, 0.006312485784292221, 0.025740083307027817, 0.029488155618309975, -0.010022951290011406, -0.02851596660912037, -0.05354463681578636, -0.061981018632650375, -0.0613858737051487, -0.05085225775837898, 0.0004213060310576111, 0.0018194674048572779, -0.00022803973115514964, -0.03474846109747887, -0.0250700656324625, -0.008593471720814705, -0.005268577486276627, 0.04268750920891762, 0.027168525382876396, 0.07716532796621323, 0.02658631093800068, 0.038644593209028244, -0.01669098623096943, 0.0606553815305233, 0.02170574851334095, -0.21945731341838837, 0.08253747224807739, 0.0622808113694191, 0.009658417664468288, -0.023930644616484642, -0.0203543771058321, 0.04433015361428261, 0.0268886499106884, -0.08202069997787476, 0.013480141758918762, -0.015138345770537853, 0.017140915617346764, 0.05600065365433693, -0.06697237491607666, -0.003984960727393627, -0.060691386461257935, 0.009749802760779858, 0.029008863493800163, -0.06388255953788757, 0.0014044368872419, -0.02220221981406212, -0.02882111258804798, -0.0032535705249756575, 0.030742648988962173, 0.07632508873939514, -0.01604263111948967, 0.04586967080831528, 0.02475626766681671, 0.00032749486854299903, 0.022261248901486397, -0.006663172971457243, 0.0597539059817791, -0.07995136082172394, 0.026836436241865158, 0.07050878554582596, 0.047024790197610855, 0.010770605877041817, 0.19495391845703125, -0.03871951624751091, 0.01348939910531044, -0.028662918135523796, -0.017360880970954895, 0.03654248267412186, -0.043385621160268784, -0.01892687939107418, -0.0038757140282541513, -0.006612447090446949, 0.004520758055150509, -0.02905154600739479, 0.011507339775562286, 0.060943152755498886, -0.06342431902885437, 0.03543061017990112, 0.03647525608539581, -0.030272163450717926, 0.011547745205461979, -0.004009599331766367, 0.053596869111061096, -0.01829788275063038, 0.01727122999727726, -0.0005385364056564867, 0.02280460111796856, 0.031300224363803864, 0.0029482420068234205, 0.06012151762843132, 0.1227133721113205, 0.026076626032590866, 0.03660174831748009, 0.04274250194430351, -0.016171691939234734, -0.10384296625852585, -0.03980110213160515, 0.012839428149163723, 0.01165440771728754, -0.0403435043990612, 0.02484079822897911, 0.010995667427778244, 0.011583469808101654, -0.05939273536205292, -0.09365925192832947, -0.04143580049276352, -0.08687503635883331, 0.005258813966065645, 0.15571187436580658, -0.04151841998100281, 0.06826503574848175, -0.028504107147455215, 0.00488804467022419, -0.027009181678295135, 0.01624187082052231, -0.06211991235613823, -0.0292197298258543, -0.023082107305526733, 0.02517399936914444, 0.06849353760480881, 0.05719068646430969, -0.02871609292924404, -0.04384041205048561, -0.04697525501251221, 0.003584897378459573, -0.08250103890895844, 0.054712969809770584, 0.024238349869847298, -0.08964913338422775, -0.03146592527627945, 0.020531723275780678, -0.008483621291816235, -0.07450579851865768, 0.02955816499888897, 0.04735124111175537, -0.06981814652681351, 0.0004312399832997471, 0.10595551878213882, 0.013587107881903648, -0.0339253768324852, -0.01969161257147789, 0.07466021925210953, 0.01457784604281187, 0.04508645832538605, -0.02891247719526291, -0.04835570976138115, 0.026181649416685104, -0.008101006038486958, -0.07144319266080856, -0.03472604602575302, -0.032806336879730225, 0.03853684291243553, 0.024936925619840622, 0.028261616826057434, -0.035339582711458206, -0.044345565140247345, 0.016962355002760887, -0.02965506911277771, -0.05123729631304741, -0.0015444192104041576, -0.0047664945013821125, -0.0015293011674657464, -0.003509956644847989, 0.08700655400753021, 0.030113348737359047, -0.02651926316320896, 0.044297534972429276, 0.0019662179984152317, 0.02006778120994568, -0.01660121977329254, -0.02115805819630623, 0.09748963266611099, -0.018772181123495102, 0.0009636071044951677, 0.01840750128030777, 0.06149043142795563, -0.0014067312004044652, -0.03085084818303585, 0.012641146779060364, 0.01213693618774414, 0.045742712914943695, 0.011431196704506874, 0.02864701673388481, 0.057143859565258026, -0.09899558126926422, -0.027940338477492332, -0.24103133380413055, -0.02767813391983509, 0.046108491718769073, -0.02949167974293232, -0.003046175930649042, -0.04291033372282982, -0.0001527065905975178, -0.014122800901532173, 0.0307054091244936, 0.08462736755609512, 0.07366936653852463, -0.013070300221443176, -0.0011241795727983117, -0.03742900490760803, 0.003501534927636385, 0.022532833740115166, 0.029385339468717575, 0.0045976233668625355, -0.017845915630459785, -0.027131088078022003, -0.016960622742772102, -0.012954526580870152, -0.032075367867946625, -0.058248959481716156, 0.06292328238487244, 0.004123130347579718, 0.21351608633995056, -0.002174901310354471, 0.02589230425655842, -0.0373726561665535, 0.0008701067417860031, -0.007293869741261005, -0.023385224863886833, -0.07844170928001404, 0.07905331254005432, 0.010413480922579765, 0.03185131400823593, 0.015562260523438454, -0.049572866410017014, -0.0104436120018363, 0.003778470680117607, 0.044660285115242004, 0.031176438555121422, -0.0413174070417881, -0.013013487681746483, -0.034124601632356644, -0.007396032568067312, -0.004071591887623072, -0.05395105108618736, 0.04299983009696007, 0.019593263044953346, 0.0004465837264433503, 0.0751514881849289, 0.022917259484529495, 0.008312082849442959, -0.04102165624499321, -0.06480884552001953, 0.02497181110084057, -0.050042182207107544, -0.008272073231637478, -0.02054610848426819, -0.06052820011973381, 0.0368071086704731, -0.01635647751390934, 0.04330581799149513, -0.05319720506668091, -0.011840338818728924, -0.03172245994210243, 0.0186874158680439, -0.02033315971493721, -0.008233522064983845, 0.08206123858690262, -0.009084788151085377, 0.02502027526497841, 0.06587489694356918, 0.0473020039498806, 0.004030248150229454, -0.0038584815338253975, -0.053209565579891205, -0.008103467524051666, 0.0873093530535698, -0.01813119649887085, 0.020232606679201126, 0.029221370816230774, 0.07796891033649445, -0.010538107715547085, 0.07642167806625366, -0.04844319447875023, 0.0002863445843104273, 0.008558383211493492, -0.034083008766174316, -0.03508484736084938, -0.05908409133553505, 0.01922205463051796, 0.01833721250295639, 0.024393180385231972, -0.26392409205436707, 0.01446862518787384, -0.0408339761197567, 0.02147809788584709, 0.012039926834404469, 0.035611797124147415, 0.01230083592236042, 0.03755607455968857, -0.048634327948093414, -0.004828814882785082, -0.006329786032438278, 0.017001697793602943, 0.034999389201402664, -0.01817728951573372, -0.01725563406944275, 0.046560343354940414, 0.029137391597032547, -0.03748372569680214, 0.010596959851682186, -0.012851651757955551, 0.05152695253491402, 0.03102264367043972, 0.19472497701644897, -0.00420513516291976, 0.024606075137853622, 0.008667968213558197, -0.03426476940512657, 0.036042843014001846, 0.10584846884012222, 0.020962579175829887, 0.022378863766789436, -0.020911481231451035, 0.06449107825756073, -0.011308628134429455, 0.024256631731987, 0.06257200241088867, -0.0539960078895092, 0.059785544872283936, 0.007007793057709932, -0.06635647267103195, 0.021450845524668694, 0.006306705065071583, -0.03858437016606331, -0.03347507491707802, 0.11206155270338058, -0.03650030493736267, -0.0659194067120552, -0.11068982630968094, 0.03402547165751457, 0.006338158156722784, -0.048566605895757675, 0.0278299693018198, 0.008635352365672588, -0.0074972109869122505, 0.018035942688584328, 0.004402873106300831, -0.0019998853094875813, 0.018363265320658684, 0.013377171941101551, -0.05532329902052879, 0.017388779670000076, -0.0881514772772789, 0.00201659114100039, 0.00893574021756649, 0.02012445405125618 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
# print the dataframe to see the modified data print(df) ``` //OUTPUT ![Output of modified DataFrame As you can see, we have successfully added a new column to our DataFrame. Now, we would like to persist the modified DataFrame data into a database so that we can run more analytics on it later. So, let’s write this data back to MongoDB using PyMongoArrow’s write function. We will just create a new collection called “my_new_collection” in our database to write the modified DataFrame back into MongoDB, ensuring data persistence. ``` from pymongoarrow.api import write coll = db.my_new_collection # write data from pandas into MongoDB collection called 'coll' write(coll, df) # Now, let's verify that the modified data has been written into our collection print(coll.find_one({})) ``` Congratulations on successfully completing this tutorial. ## Conclusion
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.078060083091259, -0.0030512537341564894, 0.03153345361351967, -0.017141783609986305, 0.04606259986758232, -0.010908172465860844, -0.011986853554844856, 0.022587735205888748, 0.01934535801410675, 0.016831642016768456, 0.016215167939662933, -0.09327299892902374, 0.037156861275434494, 0.01418194267898798, -0.05318249762058258, -0.019073789939284325, -0.042113520205020905, -0.0026589492335915565, -0.09198668599128723, 0.015232873149216175, -0.0184970423579216, -0.05999061465263367, -0.04476022347807884, -0.041502468287944794, 0.048727016896009445, 0.10065662860870361, 0.002680548932403326, 0.003105154726654291, -0.03931501507759094, -0.2166716456413269, -0.00913972407579422, -0.06707749515771866, 0.01104074064642191, -0.055921636521816254, 0.02527739480137825, -0.016536055132746696, 0.006995087023824453, 0.02397962473332882, 0.013590755872428417, 0.04911370202898979, 0.05170866474509239, -0.007880720309913158, -0.04935066029429436, -0.05893883854150772, -0.051662348210811615, -0.0528118759393692, -0.024137651547789574, -0.03467444330453873, 0.017566610127687454, -0.020485885441303253, -0.03459015488624573, -0.044140201061964035, -0.04372972249984741, 0.004719327203929424, 0.05162923410534859, 0.06223771721124649, 0.06276726722717285, 0.01809338852763176, 0.02300029806792736, -0.02835514023900032, 0.07449845224618912, 0.03141753003001213, -0.18580950796604156, 0.09083031117916107, 0.04612279310822487, 0.05120634660124779, -0.05653970316052437, -0.03737637773156166, 0.0635254830121994, 0.03395975008606911, -0.05939579755067825, -0.008075648918747902, -0.03370530903339386, 0.07965099811553955, 0.032033104449510574, -0.03764928877353668, -0.02708093635737896, -0.06719230860471725, -0.015736950561404228, 0.05933942645788193, -0.06856807321310043, -0.03361355885863304, -0.008356960490345955, 0.008254951797425747, -0.02322007529437542, -0.021606899797916412, 0.033245354890823364, -0.03353278711438179, 0.024892954155802727, 0.005485149100422859, 0.014338085427880287, -0.001341304276138544, 0.03154734522104263, 0.05303044617176056, -0.08906132727861404, 0.01747802086174488, 0.058327168226242065, 0.04479559510946274, 0.027805959805846214, 0.20839877426624298, -0.05478345975279808, 0.025549041107296944, -0.01780059188604355, 0.01828138530254364, 0.02574409730732441, -0.06858231872320175, 0.016651472076773643, -0.0292118601500988, -0.012189358472824097, 0.0037497517187148333, -0.019170356914401054, -0.01055708434432745, 0.03486889228224754, -0.08139228820800781, 0.053097859025001526, 0.010959846898913383, -0.03639792278409004, 0.04083891585469246, -0.060501616448163986, 0.03896495699882507, -0.006569405551999807, 0.02815299667418003, 0.040475647896528244, 0.0031457606237381697, 0.04395157843828201, -0.013372054323554039, 0.057712242007255554, 0.09867650270462036, 0.011832080781459808, 0.04608440771698952, 0.020171042531728745, -0.011387525126338005, -0.096161849796772, -0.023146430030465126, -0.0002949805639218539, 0.0012010710779577494, -0.004757558461278677, -0.003477333579212427, 0.07943299412727356, 0.00872541218996048, -0.0034374049864709377, -0.06078010052442551, -0.030155185610055923, -0.07369838654994965, 0.008805450983345509, 0.14608290791511536, -0.01313393097370863, 0.08078726381063461, -0.04360414296388626, -0.01680934987962246, 0.0019567813724279404, 0.02171318046748638, -0.03293405473232269, -0.02727765589952469, 0.023096296936273575, 0.02219678834080696, 0.049031373113393784, 0.08011025935411453, -0.03586452826857567, -0.03452432528138161, -0.015803825110197067, -0.010488413274288177, -0.046196844428777695, 0.06501201540231705, -0.008968513458967209, -0.11116985976696014, 0.0007682777941226959, 0.01776055619120598, 0.017393531277775764, -0.0646921917796135, 0.011983733624219894, 0.02763669192790985, -0.0812741369009018, -0.007709022145718336, 0.05542004853487015, 0.0193331316113472, -0.049032531678676605, 0.010278904810547829, 0.043691784143447876, 0.007013623137027025, 0.03450208902359009, -0.014753553085029125, -0.02673485316336155, -0.013833868317306042, 0.02045164257287979, -0.0828830674290657, -0.034721601754426956, -0.02164381928741932, 0.04949773848056793, 0.05013952776789665, 0.011015880852937698, 0.018370145931839943, 0.0122889569029212, -0.02189451828598976, -0.04729968681931496, -0.05051732435822487, 0.0019324341556057334, -0.03218802437186241, 0.0005343827069737017, -0.04577578231692314, 0.056442659348249435, 0.04220566526055336, -0.00407849857583642, 0.05993878096342087, 0.015261010266840458, 0.0009202908840961754, -0.02732926420867443, -0.013420761562883854, 0.07026055455207825, -0.020807990804314613, -0.024779576808214188, 0.011363803409039974, 0.037559736520051956, 0.004658593330532312, -0.06765144318342209, 0.002689280780032277, 0.015274278819561005, 0.01982375979423523, 0.030996670946478844, 0.0036492100916802883, 0.03473345562815666, -0.08999521285295486, -0.007423626258969307, -0.25889167189598083, -0.004242610186338425, 0.016540542244911194, 0.008497404865920544, -0.007768266834318638, -0.06989538669586182, 0.024211905896663666, 0.0002609089424367994, -0.011122508905827999, 0.049310971051454544, 0.06597953289747238, 0.000202074515982531, 0.012126346118748188, 0.010415520519018173, -0.003200907725840807, 0.02586015686392784, 0.026701483875513077, 0.006650940980762243, -0.023438766598701477, -0.00912470556795597, -0.05206627398729324, 0.0014894013293087482, -0.01674445904791355, -0.06591730564832687, 0.034633439034223557, -0.0037003958132117987, 0.22295957803726196, 0.012649905867874622, 0.01133779063820839, -0.030503595247864723, 0.008211834356188774, -0.011578027158975601, -0.03859858959913254, -0.1294151097536087, 0.04689520224928856, -0.00026762348716147244, -0.004759214818477631, 0.07125471532344818, -0.02490946836769581, -0.06255784630775452, 0.028181301429867744, 0.037361595779657364, 0.003462038468569517, -0.07884843647480011, -0.0013598677469417453, -0.014144780114293098, -0.06394686549901962, -0.032049402594566345, -0.06276056915521622, 0.06844823062419891, 0.010399646125733852, 0.025732163339853287, 0.06396526843309402, 0.0102143669500947, -0.02456550858914852, -0.026609038934111595, -0.06910611689090729, 0.0711553543806076, -0.030156800523400307, 0.020302437245845795, -0.006397663149982691, -0.030174311250448227, 0.01587994210422039, -0.008337579667568207, 0.0668218582868576, -0.01637355051934719, 0.00979237724095583, -0.04043230414390564, 0.028763867914676666, -0.03910769149661064, -0.014758596196770668, 0.06786943972110748, -0.01762135699391365, 0.013441840186715126, 0.05972367897629738, 0.047123510390520096, -0.01717127114534378, -0.0032333864364773035, -0.05172981321811676, -0.03782152384519577, 0.0793878510594368, -0.03915373980998993, 0.034465014934539795, 0.05619793012738228, 0.0678284764289856, 0.031524013727903366, 0.07082541286945343, -0.00523981312289834, -0.010759294964373112, 0.008121637627482414, -0.011819564737379551, -0.04519038647413254, -0.03959520906209946, -0.003298363648355007, 0.022179830819368362, 0.023829355835914612, -0.2768873870372772, 0.01649363525211811, -0.03934582322835922, 0.002513327170163393, 0.01914926804602146, 0.023417187854647636, 0.02075372077524662, 0.030643027275800705, -0.04114515334367752, 0.04464564472436905, 0.019813312217593193, 0.012269265949726105, 0.03777744621038437, 0.01759577915072441, -0.0076032779179513454, 0.05219939351081848, 0.05626952648162842, -0.03268026188015938, 0.023843830451369286, -0.02071177214384079, 0.052870430052280426, 0.04022349789738655, 0.19430822134017944, -0.0010961642256006598, 0.03498369827866554, 0.02766592800617218, 0.023224875330924988, 0.040443744510412216, 0.06873578578233719, 0.028758099302649498, 0.00784253142774105, -0.029923373833298683, 0.04184158891439438, -0.01203032024204731, 0.024118604138493538, 0.0448165088891983, -0.06627339869737625, 0.062000349164009094, 0.04277127608656883, -0.06629973649978638, -0.03653012588620186, 0.012348203919827938, -0.02125256508588791, -0.018862774595618248, 0.11324065923690796, -0.01699024997651577, -0.060742732137441635, -0.08446837961673737, -0.004610990174114704, 0.023389825597405434, -0.04160907119512558, -0.012566487304866314, 0.0044889491982758045, -0.010835151188075542, 0.019960952922701836, 0.01980559527873993, 0.0031706022564321756, 0.02411573752760887, 0.009826104156672955, -0.031104011461138725, 0.042681772261857986, -0.08668282628059387, 0.01986418105661869, -0.0023725812789052725, -0.001343699754215777 ]
devcenter
https://www.mongodb.com/developer/products/mongodb/time-series-data-pymongoarrow
created
print(coll.find_one({})) ``` Congratulations on successfully completing this tutorial. ## Conclusion In this tutorial, we covered how to work with time-series data using MongoDB and Python. We learned how to store stock market data in a MongoDB time-series collection, and then how to perform simple analytics using a pandas DataFrame. We also explored how PyMongoArrow makes it easy to move data between MongoDB and pandas. Finally, we saved our analyzed data back into MongoDB. This guide provides a straightforward way to manage, analyze, and store time-series data. Great job if you’ve followed along — you’re now ready to handle time-series data in your own projects. If you want to learn more about PyMongoArrow, check out some of these additional resources: 1. Video tutorial on PyMongoArrow 2. PyMongoArrow article
md
{ "tags": [ "MongoDB" ], "pageDescription": "Learn how to create and query a time-series collection in MongoDB, and analyze the data using PyMongoArrow and pandas.", "contentType": "Tutorial" }
Analyze Time-Series Data with Python and MongoDB Using PyMongoArrow and Pandas
2024-05-20T17:32:23.500Z
[ -0.03109734132885933, -0.01324787549674511, 0.01443619653582573, -0.03006911650300026, 0.0570661723613739, -0.013501067645847797, 0.013466478325426579, 0.016434788703918457, 0.03872418403625488, 0.020277461037039757, -0.006421270314604044, -0.0666084811091423, 0.022881804034113884, 0.009859305806457996, -0.002677628304809332, -0.008246077224612236, -0.05349700525403023, -0.002804310992360115, -0.06331084668636322, 0.00523119093850255, 0.012512924149632454, -0.035366881638765335, -0.058305978775024414, -0.05491843819618225, 0.06973765045404434, 0.05068785697221756, 0.024050265550613403, -0.03108546882867813, -0.031200161203742027, -0.22472134232521057, -0.0010547376004979014, -0.06874160468578339, 0.059243183583021164, -0.03904101997613907, 0.014082353562116623, 0.0004940584185533226, -0.02106969803571701, 0.04159916937351227, 0.002037310041487217, 0.07361714541912079, 0.03155112266540527, 0.010901222005486488, -0.03122848831117153, -0.05935635790228844, -0.052727822214365005, -0.07108129560947418, -0.03262763470411301, -0.030033579096198082, 0.018308700993657112, -0.015975581482052803, -0.030428117141127586, -0.0003274789487477392, -0.008485645987093449, 0.011585990898311138, 0.036893174052238464, 0.036272644996643066, 0.07009763270616531, 0.034569837152957916, 0.012011229060590267, -0.029697583988308907, 0.044187743216753006, -0.004523416981101036, -0.20787091553211212, 0.10840106755495071, 0.051362648606300354, 0.029730916023254395, -0.006544892676174641, -0.01779387891292572, 0.04566109925508499, 0.06585673987865448, -0.0297101903706789, -0.0012496276758611202, 0.008371228352189064, 0.02772901952266693, 0.031067345291376114, -0.03918812423944473, 0.008327382616698742, -0.06640816479921341, 0.009711378253996372, 0.02919921465218067, -0.06433761119842529, -0.006039987783879042, -0.03588337451219559, -0.005013434682041407, -0.01634620502591133, -0.0231556948274374, 0.02206532284617424, -0.03582069277763367, 0.03701140359044075, 0.0014124743174761534, 0.005415021441876888, -0.0011755633167922497, -0.00967416912317276, 0.047845084220170975, -0.07405399531126022, 0.006579933222383261, 0.05369306728243828, 0.054434340447187424, 0.008195187896490097, 0.21510018408298492, -0.06837479025125504, 0.030315443873405457, 0.0012517278082668781, -0.026261521503329277, 0.022549984976649284, -0.06270378828048706, -0.0010543561074882746, -0.047876663506031036, 0.026198772713541985, -0.00850162748247385, -0.00416425708681345, -0.02586027979850769, 0.03562282770872116, -0.06855926662683487, 0.028345346450805664, -0.010831364430487156, -0.011991292238235474, 0.017845701426267624, -0.018561270087957382, 0.04134223610162735, 0.005852395202964544, -0.0036986726336181164, 0.05933798477053642, -0.019060203805565834, 0.02695082500576973, -0.02189577929675579, 0.07307315617799759, 0.12142112851142883, 0.029590141028165817, 0.027196718379855156, 0.033051371574401855, -0.014379613101482391, -0.08785948902368546, -0.008882212452590466, -0.005090760998427868, 0.006976875010877848, -0.026215221732854843, 0.02269318327307701, 0.04500997066497803, -0.003441162407398224, -0.0428704209625721, -0.08815597742795944, -0.016042737290263176, -0.08221777528524399, -0.033504918217659, 0.13973483443260193, -0.002713229274377227, 0.07471256703138351, -0.054777275770902634, -0.01771753467619419, -0.04570142924785614, 0.04085640236735344, -0.0559074804186821, -0.036403484642505646, 0.02190161868929863, 0.03167828172445297, 0.08713308721780777, 0.056125011295080185, -0.03064647503197193, -0.013339263387024403, -0.06699378043413162, -0.025207271799445152, -0.03969071805477142, 0.050202932208776474, -0.0040615336038172245, -0.13438984751701355, -0.005839410703629255, 0.017781414091587067, 0.00759308272972703, -0.07097811251878738, 0.034657906740903854, 0.04085656255483627, -0.06809236854314804, 0.037286821752786636, 0.09014048427343369, 0.026788542047142982, -0.020994538441300392, 0.01107250340282917, 0.04157056286931038, 0.01985257677733898, 0.008272852748632431, -0.04690411686897278, -0.02040131203830242, 0.0013680816628038883, 0.016997074708342552, -0.06759865581989288, -0.014375853352248669, -0.030954977497458458, 0.010014841333031654, 0.03319941461086273, 0.01670689880847931, -0.025149108842015266, -0.0033977741841226816, -0.005685423035174608, -0.037452951073646545, -0.034047503024339676, -0.012257864698767662, -0.03537212684750557, 0.01990930177271366, -0.05032821372151375, 0.0671767145395279, -0.005395745392888784, -0.02175356261432171, 0.0356953889131546, 0.021240733563899994, 0.005570991430431604, -0.022639010101556778, 0.006736344192177057, 0.07263955473899841, -0.03825110197067261, -0.013310059905052185, 0.037518471479415894, 0.02290204167366028, -0.04157053306698799, -0.02770864963531494, -0.012640463188290596, 0.027237243950366974, 0.03972684219479561, 0.01350418571382761, 0.04415252432227135, 0.010752489790320396, -0.10226192325353622, -0.04142718389630318, -0.24746477603912354, -0.014612038619816303, 0.01697053574025631, 0.02490438148379326, 0.003051621373742819, -0.05416061729192734, 0.01075802929699421, -0.010420547798275948, 0.004918764811009169, 0.07377146184444427, 0.06506434828042984, -0.008630586788058281, -0.005419563502073288, -0.014287658035755157, -0.012289995327591896, 0.056995801627635956, 0.02811206877231598, 0.04929168522357941, -0.04266800731420517, 0.020218512043356895, -0.014609151519834995, -0.004914604593068361, -0.019688928499817848, -0.07352694123983383, 0.03740683197975159, 0.0067376671358942986, 0.19344304502010345, 0.05234111472964287, 0.017430691048502922, -0.02683289907872677, 0.0159767996519804, -0.02852308563888073, -0.05037617310881615, -0.09080924093723297, 0.04829741641879082, 0.027069438248872757, 0.0373876579105854, 0.016920723021030426, -0.0564219169318676, -0.028823113068938255, -0.0027833369094878435, 0.052227746695280075, 0.033642176538705826, -0.02276080846786499, -0.025606852024793625, -0.03707291558384895, -0.018540026620030403, -0.027665935456752777, -0.057529788464307785, 0.051039919257164, 0.015165667980909348, 0.018665149807929993, 0.08525774627923965, 0.002991840709000826, -0.022106468677520752, -0.043668460100889206, -0.0604475736618042, 0.047731634229421616, -0.03384130075573921, 0.03325377404689789, -0.024323860183358192, -0.052288055419921875, 0.04757116734981537, -0.01638127863407135, 0.06374376267194748, 0.005597884301096201, -0.02089351788163185, -0.03222193568944931, 0.020612573251128197, -0.030357474461197853, -0.014153389260172844, 0.08451005816459656, -0.037712566554546356, 0.03305785730481148, 0.0341624952852726, 0.03588235750794411, 0.01465357095003128, -0.022428613156080246, -0.05711648240685463, -0.02139160968363285, 0.049428123980760574, -0.034984126687049866, 0.031668324023485184, 0.044325392693281174, 0.058265723288059235, 0.010701034218072891, 0.0884629487991333, -0.021644309163093567, 0.023570377379655838, -0.021651623770594597, -0.02723810449242592, -0.01056947372853756, -0.04779176786541939, -0.005052921362221241, 0.013826953247189522, 0.05522893741726875, -0.29917794466018677, 0.05252394452691078, -0.017712585628032684, 0.02172098308801651, 0.02108917199075222, 0.014535223133862019, 0.03598915413022041, 0.01809760183095932, -0.015879858285188675, 0.02409427799284458, 0.019297003746032715, 0.007411750964820385, 0.044197361916303635, -0.009898428805172443, -0.01807081326842308, 0.039918072521686554, 0.06318823993206024, -0.05754382535815239, 0.022424468770623207, -0.008552773855626583, 0.06929280608892441, 0.04720866680145264, 0.22320255637168884, -0.021426910534501076, 0.01589374616742134, 0.017835823819041252, 0.0032307389192283154, -0.02991933934390545, 0.07975093275308609, 0.006689458154141903, 0.013739068061113358, -0.0067437817342579365, 0.05437305197119713, -0.047520458698272705, 0.03621581941843033, 0.06988257169723511, -0.057910989969968796, 0.03344104066491127, 0.02605871483683586, -0.03805220499634743, -0.005698624532669783, 0.009273494593799114, -0.016642875969409943, -0.016307778656482697, 0.09361521899700165, -0.03883981332182884, -0.04309486225247383, -0.09968561679124832, 0.01707642152905464, 0.01150926947593689, -0.08678998053073883, -0.010501817800104618, -0.04352860897779465, 0.007916548289358616, 0.014117158949375153, 0.053944095969200134, -0.002714748028665781, 0.012501150369644165, 0.02157880738377571, -0.0618087463080883, 0.014958055689930916, -0.0916425958275795, 0.015075203031301498, 0.024886325001716614, 0.026690905913710594 ]