{"cells":[{"cell_type":"markdown","source":"# Leer los datos","metadata":{"id":"Tv-Ic-T3QdOT","cell_id":"77f72c0217d447d9bf9e6eb7f0326447","deepnote_cell_type":"markdown"}},{"cell_type":"code","source":"import pandas as pd\nimport matplotlib.pyplot as plt\nurl='https://raw.githubusercontent.com/JJTorresDS/ds-data-sources/main/stocks.csv'\ndf= pd.read_csv(url,index_col='formatted_date',parse_dates=['formatted_date'])\ndf","metadata":{"id":"iuafFQ5YQFXk","colab":{"height":519,"base_uri":"https://localhost:8080/"},"cell_id":"cbd91238936f4650b83c115fb02872a8","outputId":"91a92dc5-2535-465c-c88e-b3125ca40f7a","executionInfo":{"user":{"userId":"09471607480253994520","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjvGjd5VpSUEHTxlxXRYAinh8eCspL5nxvcW9wD=s64","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":308,"user_tz":300,"timestamp":1646789929721},"deepnote_cell_type":"code"},"outputs":[{"output_type":"execute_result","data":{"text/html":"\n
\n | MCD | \nSBUX | \nGOOG | \nAMZN | \nMSFT | \nJPM | \nBAC | \nC | \nMAR | \nHLT | \nRCL | \nV | \nMA | \nPYPL | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
formatted_date | \n\n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n |
2016-01-01 | \n106.332146 | \n54.353962 | \n742.950012 | \n587.000000 | \n49.853489 | \n50.424938 | \n12.573010 | \n36.897804 | \n57.754189 | \n35.192841 | \n74.235298 | \n71.574371 | \n85.822624 | \n36.139999 | \n
2016-02-01 | \n100.671043 | \n52.064243 | \n697.770020 | \n552.520020 | \n46.043667 | \n48.033066 | \n11.132540 | \n33.707108 | \n64.228912 | \n41.061607 | \n67.360649 | \n69.556580 | \n83.956566 | \n38.139999 | \n
2016-03-01 | \n108.782211 | \n53.571442 | \n744.950012 | \n593.640015 | \n50.339031 | \n50.524323 | \n12.021718 | \n36.223217 | \n67.336624 | \n44.499886 | \n74.790009 | \n73.631477 | \n91.278160 | \n38.599998 | \n
2016-04-01 | \n109.483307 | \n50.457645 | \n693.010010 | \n659.590027 | \n45.453705 | \n53.919910 | \n12.995729 | \n40.153545 | \n66.305466 | \n43.716049 | \n70.465584 | \n74.363144 | \n93.683258 | \n39.180000 | \n
2016-05-01 | \n105.648926 | \n49.255203 | \n735.719971 | \n722.789978 | \n48.306515 | \n56.098225 | \n13.201019 | \n40.447887 | \n62.474155 | \n41.198154 | \n70.456474 | \n75.999847 | \n92.817329 | \n37.790001 | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n
2021-07-01 | \n240.055786 | \n120.441193 | \n2704.419922 | \n3327.590088 | \n283.846313 | \n150.006454 | \n37.981613 | \n66.635887 | \n145.979996 | \n131.449997 | \n76.870003 | \n245.622177 | \n384.999420 | \n275.529999 | \n
2021-08-01 | \n234.863205 | \n116.533272 | \n2909.239990 | \n3470.790039 | \n300.752960 | \n158.991928 | \n41.338173 | \n71.392593 | \n135.139999 | \n124.860001 | \n82.730003 | \n228.386063 | \n345.793121 | \n288.660004 | \n
2021-09-01 | \n239.780670 | \n109.836403 | \n2665.310059 | \n3285.040039 | \n281.405182 | \n162.709534 | \n42.031269 | \n69.675041 | \n148.089996 | \n132.110001 | \n88.949997 | \n222.358551 | \n347.241272 | \n260.209991 | \n
2021-10-01 | \n244.196198 | \n105.614609 | \n2965.409912 | \n3372.429932 | \n331.014404 | \n168.872391 | \n47.551128 | \n68.662384 | \n160.020004 | \n143.949997 | \n84.430000 | \n211.397858 | \n335.096588 | \n232.589996 | \n
2021-11-01 | \n243.251434 | \n109.169281 | \n2849.040039 | \n3507.070068 | \n329.986298 | \n158.830002 | \n44.256985 | \n63.700001 | \n147.559998 | \n135.070007 | \n69.820000 | \n193.429489 | \n314.920013 | \n184.889999 | \n
71 rows × 14 columns
\n\n | MCD | \nSBUX | \nGOOG | \nAMZN | \nMSFT | \nJPM | \nBAC | \nC | \nMAR | \nHLT | \nRCL | \nV | \nMA | \nPYPL | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MCD | \n1.000000 | \n0.911649 | \n0.872950 | \n0.915207 | \n0.921861 | \n0.900587 | \n0.857553 | \n0.598726 | \n0.758567 | \n0.941815 | \n0.052275 | \n0.961073 | \n0.956230 | \n0.889973 | \n
SBUX | \n0.911649 | \n1.000000 | \n0.900343 | \n0.874861 | \n0.925871 | \n0.854682 | \n0.775915 | \n0.463075 | \n0.608303 | \n0.895421 | \n-0.138369 | \n0.908692 | \n0.907381 | \n0.921438 | \n
GOOG | \n0.872950 | \n0.900343 | \n1.000000 | \n0.898136 | \n0.961937 | \n0.909442 | \n0.876196 | \n0.530359 | \n0.647768 | \n0.905074 | \n-0.130685 | \n0.855338 | \n0.841940 | \n0.927271 | \n
AMZN | \n0.915207 | \n0.874861 | \n0.898136 | \n1.000000 | \n0.963040 | \n0.831325 | \n0.773567 | \n0.414525 | \n0.596446 | \n0.859951 | \n-0.207798 | \n0.948422 | \n0.951015 | \n0.959953 | \n
MSFT | \n0.921861 | \n0.925871 | \n0.961937 | \n0.963040 | \n1.000000 | \n0.873916 | \n0.818282 | \n0.436713 | \n0.596887 | \n0.897585 | \n-0.232318 | \n0.929751 | \n0.926621 | \n0.951394 | \n
JPM | \n0.900587 | \n0.854682 | \n0.909442 | \n0.831325 | \n0.873916 | \n1.000000 | \n0.982349 | \n0.794576 | \n0.872046 | \n0.978772 | \n0.202581 | \n0.871820 | \n0.859420 | \n0.844586 | \n
BAC | \n0.857553 | \n0.775915 | \n0.876196 | \n0.773567 | \n0.818282 | \n0.982349 | \n1.000000 | \n0.841762 | \n0.899805 | \n0.950060 | \n0.292480 | \n0.805341 | \n0.789793 | \n0.773794 | \n
C | \n0.598726 | \n0.463075 | \n0.530359 | \n0.414525 | \n0.436713 | \n0.794576 | \n0.841762 | \n1.000000 | \n0.913796 | \n0.740547 | \n0.686983 | \n0.531859 | \n0.510164 | \n0.439464 | \n
MAR | \n0.758567 | \n0.608303 | \n0.647768 | \n0.596446 | \n0.596887 | \n0.872046 | \n0.899805 | \n0.913796 | \n1.000000 | \n0.871625 | \n0.581135 | \n0.692143 | \n0.679711 | \n0.580950 | \n
HLT | \n0.941815 | \n0.895421 | \n0.905074 | \n0.859951 | \n0.897585 | \n0.978772 | \n0.950060 | \n0.740547 | \n0.871625 | \n1.000000 | \n0.170140 | \n0.912165 | \n0.905176 | \n0.862439 | \n
RCL | \n0.052275 | \n-0.138369 | \n-0.130685 | \n-0.207798 | \n-0.232318 | \n0.202581 | \n0.292480 | \n0.686983 | \n0.581135 | \n0.170140 | \n1.000000 | \n-0.056921 | \n-0.070195 | \n-0.203879 | \n
V | \n0.961073 | \n0.908692 | \n0.855338 | \n0.948422 | \n0.929751 | \n0.871820 | \n0.805341 | \n0.531859 | \n0.692143 | \n0.912165 | \n-0.056921 | \n1.000000 | \n0.996748 | \n0.921974 | \n
MA | \n0.956230 | \n0.907381 | \n0.841940 | \n0.951015 | \n0.926621 | \n0.859420 | \n0.789793 | \n0.510164 | \n0.679711 | \n0.905176 | \n-0.070195 | \n0.996748 | \n1.000000 | \n0.918581 | \n
PYPL | \n0.889973 | \n0.921438 | \n0.927271 | \n0.959953 | \n0.951394 | \n0.844586 | \n0.773794 | \n0.439464 | \n0.580950 | \n0.862439 | \n-0.203879 | \n0.921974 | \n0.918581 | \n1.000000 | \n
\n | variable | \nvalue | \n
---|---|---|
0 | \nMCD | \n106.332146 | \n
1 | \nMCD | \n100.671043 | \n
2 | \nMCD | \n108.782211 | \n
3 | \nMCD | \n109.483307 | \n
4 | \nMCD | \n105.648926 | \n
... | \n... | \n... | \n
989 | \nPYPL | \n275.529999 | \n
990 | \nPYPL | \n288.660004 | \n
991 | \nPYPL | \n260.209991 | \n
992 | \nPYPL | \n232.589996 | \n
993 | \nPYPL | \n184.889999 | \n
994 rows × 2 columns
\n