diff --git a/Spanish stocks/.ipynb_checkpoints/Spanish stocks-checkpoint.ipynb b/Spanish stocks/.ipynb_checkpoints/Spanish stocks-checkpoint.ipynb
new file mode 100644
index 00000000..ffbc35ce
--- /dev/null
+++ b/Spanish stocks/.ipynb_checkpoints/Spanish stocks-checkpoint.ipynb
@@ -0,0 +1,1186 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:29.357781Z",
+ "iopub.status.busy": "2021-02-09T01:12:29.357024Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.307435Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.306436Z"
+ },
+ "papermill": {
+ "duration": 0.976147,
+ "end_time": "2021-02-09T01:12:30.307704",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:29.331557",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "from mpl_toolkits.mplot3d import Axes3D\n",
+ "from sklearn.preprocessing import StandardScaler\n",
+ "import matplotlib.pyplot as plt # plotting\n",
+ "import numpy as np # linear algebra\n",
+ "import os # accessing directory structure\n",
+ "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.390896Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.390243Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.446354Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.445695Z"
+ },
+ "papermill": {
+ "duration": 0.080434,
+ "end_time": "2021-02-09T01:12:30.446517",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.366083",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PQR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BIOS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TLGO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NXTE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTEM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YORS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRLS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FAE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MEDC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CASHP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YHAB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRKM3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/A3M.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VID.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBES.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VIS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YORE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CCEP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EBRO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YEPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MASM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FLUI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SLRS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IDR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/DIDA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MRL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLNX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YMRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ORY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SGREN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TEF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TVAZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSCI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SABE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NATR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LOG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BAINS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/QBT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LLN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BME.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SECU.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YISC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPR3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPSNA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTRA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YCPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SAN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MDF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IKM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRLSbn.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/UBS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GIGAH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PETR3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/XNOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALNTA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YFID.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AZK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YENT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GCO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/DOMI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EBI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YMHRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TUBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AEDAS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGOP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AMA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PROE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBAR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRPP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AENA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CATN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BDL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELTB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGOB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELZZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RBT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NEA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAC1.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAML.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MVC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YATO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ACX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RLIA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PETR4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/OLEO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ITX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ISUR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LRES.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAP67.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/INC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/COL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSRR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CAF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YABA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/USIO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKIA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTGY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENAG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ECR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VTSG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CMIG4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YZBL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ZOT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MCM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MTS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALFAA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NHH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRIO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IMGI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YURO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MTBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YEXR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EESP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SPSL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRPO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CABK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GGBR4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RJFE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SNCE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MONIB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EZEN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MAP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GEST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TL5.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AMXL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FER.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SPK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGMP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELTO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CCMC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ROVI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GREG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TUR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABGek.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PANGO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRIE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YOVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ANA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APAM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LGT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FACE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ACS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CMM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YQPQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/HOME.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CDRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RTA4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EUWT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EKTL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LBK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PRIM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CPLE6.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EATP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PHMR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CEV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPARK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YDOM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADXR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/USIM5.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IFFE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABBO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/UNI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GSJ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PSG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ICAG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AGIL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TR1.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SCYR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MEL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADLB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ATRY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CRBHO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YQUO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBDC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RDM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GALQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGGC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VALO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/OHL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ARM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EDRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVIT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CIEA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FCC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YARE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELEKTRA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YARP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVIV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CBAV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NBIB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AIR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOLB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YNUM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PRS.csv\n"
+ ]
+ }
+ ],
+ "source": [
+ "for dirname, _, filenames in os.walk('/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices'):\n",
+ " for filename in filenames:\n",
+ " print(os.path.join(dirname, filename))\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.539004Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.538346Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.541456Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.540840Z"
+ },
+ "papermill": {
+ "duration": 0.033336,
+ "end_time": "2021-02-09T01:12:30.541610",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.508274",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Distribution graphs (histogram/bar graph) of column data\n",
+ "def plotPerColumnDistribution(df, nGraphShown, nGraphPerRow):\n",
+ " nunique = df.nunique()\n",
+ " df = df[[col for col in df if nunique[col] > 1 and nunique[col] < 50]] # For displaying purposes, pick columns that have between 1 and 50 unique values\n",
+ " nRow, nCol = df.shape\n",
+ " columnNames = list(df)\n",
+ " nGraphRow = (nCol + nGraphPerRow - 1) / nGraphPerRow\n",
+ " plt.figure(num = None, figsize = (6 * nGraphPerRow, 8 * nGraphRow), dpi = 80, facecolor = 'w', edgecolor = 'k')\n",
+ " for i in range(min(nCol, nGraphShown)):\n",
+ " plt.subplot(nGraphRow, nGraphPerRow, i + 1)\n",
+ " columnDf = df.iloc[:, i]\n",
+ " if (not np.issubdtype(type(columnDf.iloc[0]), np.number)):\n",
+ " valueCounts = columnDf.value_counts()\n",
+ " valueCounts.plot.bar()\n",
+ " else:\n",
+ " columnDf.hist()\n",
+ " plt.ylabel('counts')\n",
+ " plt.xticks(rotation = 90)\n",
+ " plt.title(f'{columnNames[i]} (column {i})')\n",
+ " plt.tight_layout(pad = 1.0, w_pad = 1.0, h_pad = 1.0)\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.590625Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.589989Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.593518Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.592998Z"
+ },
+ "papermill": {
+ "duration": 0.032108,
+ "end_time": "2021-02-09T01:12:30.593653",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.561545",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Correlation matrix\n",
+ "def plotCorrelationMatrix(df, graphWidth):\n",
+ " filename = df.dataframeName\n",
+ " df = df.dropna('columns') # drop columns with NaN\n",
+ " df = df[[col for col in df if df[col].nunique() > 1]] # keep columns where there are more than 1 unique values\n",
+ " if df.shape[1] < 2:\n",
+ " print(f'No correlation plots shown: The number of non-NaN or constant columns ({df.shape[1]}) is less than 2')\n",
+ " return\n",
+ " corr = df.corr()\n",
+ " plt.figure(num=None, figsize=(graphWidth, graphWidth), dpi=80, facecolor='w', edgecolor='k')\n",
+ " corrMat = plt.matshow(corr, fignum = 1)\n",
+ " plt.xticks(range(len(corr.columns)), corr.columns, rotation=90)\n",
+ " plt.yticks(range(len(corr.columns)), corr.columns)\n",
+ " plt.gca().xaxis.tick_bottom()\n",
+ " plt.colorbar(corrMat)\n",
+ " plt.title(f'Correlation Matrix for {filename}', fontsize=15)\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.644753Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.643664Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.647316Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.646788Z"
+ },
+ "papermill": {
+ "duration": 0.033954,
+ "end_time": "2021-02-09T01:12:30.647489",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.613535",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Scatter and density plots\n",
+ "def plotScatterMatrix(df, plotSize, textSize):\n",
+ " df = df.select_dtypes(include =[np.number]) # keep only numerical columns\n",
+ " # Remove rows and columns that would lead to df being singular\n",
+ " df = df.dropna('columns')\n",
+ " df = df[[col for col in df if df[col].nunique() > 1]] # keep columns where there are more than 1 unique values\n",
+ " columnNames = list(df)\n",
+ " if len(columnNames) > 10: # reduce the number of columns for matrix inversion of kernel density plots\n",
+ " columnNames = columnNames[:10]\n",
+ " df = df[columnNames]\n",
+ " ax = pd.plotting.scatter_matrix(df, alpha=0.75, figsize=[plotSize, plotSize], diagonal='kde')\n",
+ " corrs = df.corr().values\n",
+ " for i, j in zip(*plt.np.triu_indices_from(ax, k = 1)):\n",
+ " ax[i, j].annotate('Corr. coef = %.3f' % corrs[i, j], (0.8, 0.2), xycoords='axes fraction', ha='center', va='center', size=textSize)\n",
+ " plt.suptitle('Scatter and Density Plot')\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.019925,
+ "end_time": "2021-02-09T01:12:30.688183",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.668258",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Now you're ready to read in the data and use the plotting functions to visualize the data."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.020058,
+ "end_time": "2021-02-09T01:12:30.728410",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.708352",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "### Let's check 1st file: /kaggle/input/spain/stocks_list.csv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.774243Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.773525Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.793418Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.792821Z"
+ },
+ "papermill": {
+ "duration": 0.045318,
+ "end_time": "2021-02-09T01:12:30.793580",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.748262",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "There are 234 rows and 7 columns\n"
+ ]
+ }
+ ],
+ "source": [
+ "nRowsRead = 1000 # specify 'None' if want to read whole file\n",
+ "# stocks_list.csv may have more rows in reality, but we are only loading/previewing the first 1000 rows\n",
+ "df1 = pd.read_csv('/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/stocks_list.csv', delimiter=',', nrows = nRowsRead)\n",
+ "df1.dataframeName = 'stocks_list.csv'\n",
+ "nRow, nCol = df1.shape\n",
+ "print(f'There are {nRow} rows and {nCol} columns')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.020594,
+ "end_time": "2021-02-09T01:12:30.835230",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.814636",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Let's take a quick look at what the data looks like:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.884573Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.883881Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.905952Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.905295Z"
+ },
+ "papermill": {
+ "duration": 0.049819,
+ "end_time": "2021-02-09T01:12:30.906106",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.856287",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Unnamed: 0 | \n",
+ " country | \n",
+ " name | \n",
+ " full_name | \n",
+ " isin | \n",
+ " currency | \n",
+ " symbol | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 0 | \n",
+ " spain | \n",
+ " ACS | \n",
+ " ACS Actividades de Construccion y Servicios SA | \n",
+ " ES0167050915 | \n",
+ " EUR | \n",
+ " ACS | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1 | \n",
+ " spain | \n",
+ " Abengoa | \n",
+ " Abengoa | \n",
+ " ES0105200416 | \n",
+ " EUR | \n",
+ " ABG | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2 | \n",
+ " spain | \n",
+ " Atresmedia | \n",
+ " Atresmedia | \n",
+ " ES0109427734 | \n",
+ " EUR | \n",
+ " A3M | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 3 | \n",
+ " spain | \n",
+ " Acerinox | \n",
+ " Acerinox | \n",
+ " ES0132105018 | \n",
+ " EUR | \n",
+ " ACX | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 4 | \n",
+ " spain | \n",
+ " BBVA | \n",
+ " BBVA | \n",
+ " ES0113211835 | \n",
+ " EUR | \n",
+ " BBVA | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Unnamed: 0 country name \\\n",
+ "0 0 spain ACS \n",
+ "1 1 spain Abengoa \n",
+ "2 2 spain Atresmedia \n",
+ "3 3 spain Acerinox \n",
+ "4 4 spain BBVA \n",
+ "\n",
+ " full_name isin currency \\\n",
+ "0 ACS Actividades de Construccion y Servicios SA ES0167050915 EUR \n",
+ "1 Abengoa ES0105200416 EUR \n",
+ "2 Atresmedia ES0109427734 EUR \n",
+ "3 Acerinox ES0132105018 EUR \n",
+ "4 BBVA ES0113211835 EUR \n",
+ "\n",
+ " symbol \n",
+ "0 ACS \n",
+ "1 ABG \n",
+ "2 A3M \n",
+ "3 ACX \n",
+ "4 BBVA "
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df1.head(5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.021446,
+ "end_time": "2021-02-09T01:12:30.948877",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.927431",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Distribution graphs (histogram/bar graph) of sampled columns:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.997384Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.996669Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.015659Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.016100Z"
+ },
+ "papermill": {
+ "duration": 0.045702,
+ "end_time": "2021-02-09T01:12:31.016329",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.970627",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotPerColumnDistribution(df1, 10, 5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.022697,
+ "end_time": "2021-02-09T01:12:31.060676",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.037979",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "### Let's check 2nd file: /kaggle/input/spain/prices/ACS.csv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:31.111152Z",
+ "iopub.status.busy": "2021-02-09T01:12:31.110491Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.130537Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.131033Z"
+ },
+ "papermill": {
+ "duration": 0.048247,
+ "end_time": "2021-02-09T01:12:31.131236",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.082989",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "ename": "FileNotFoundError",
+ "evalue": "[Errno 2] No such file or directory: '/kaggle/input/spain/prices/ACS.csv'",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[0;32mIn[9], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m nRowsRead \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1000\u001b[39m \u001b[38;5;66;03m# specify 'None' if want to read whole file\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m# ACS.csv may have more rows in reality, but we are only loading/previewing the first 1000 rows\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m df2 \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/kaggle/input/spain/prices/ACS.csv\u001b[39m\u001b[38;5;124m'\u001b[39m, delimiter\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m'\u001b[39m, nrows \u001b[38;5;241m=\u001b[39m nRowsRead)\n\u001b[1;32m 4\u001b[0m df2\u001b[38;5;241m.\u001b[39mdataframeName \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mACS.csv\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 5\u001b[0m nRow, nCol \u001b[38;5;241m=\u001b[39m df2\u001b[38;5;241m.\u001b[39mshape\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/util/_decorators.py:211\u001b[0m, in \u001b[0;36mdeprecate_kwarg.._deprecate_kwarg..wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 210\u001b[0m kwargs[new_arg_name] \u001b[38;5;241m=\u001b[39m new_arg_value\n\u001b[0;32m--> 211\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/util/_decorators.py:331\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments..decorate..wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 325\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(args) \u001b[38;5;241m>\u001b[39m num_allow_args:\n\u001b[1;32m 326\u001b[0m warnings\u001b[38;5;241m.\u001b[39mwarn(\n\u001b[1;32m 327\u001b[0m msg\u001b[38;5;241m.\u001b[39mformat(arguments\u001b[38;5;241m=\u001b[39m_format_argument_list(allow_args)),\n\u001b[1;32m 328\u001b[0m \u001b[38;5;167;01mFutureWarning\u001b[39;00m,\n\u001b[1;32m 329\u001b[0m stacklevel\u001b[38;5;241m=\u001b[39mfind_stack_level(),\n\u001b[1;32m 330\u001b[0m )\n\u001b[0;32m--> 331\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/io/parsers/readers.py:950\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)\u001b[0m\n\u001b[1;32m 935\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m 936\u001b[0m dialect,\n\u001b[1;32m 937\u001b[0m delimiter,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 946\u001b[0m defaults\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdelimiter\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m\"\u001b[39m},\n\u001b[1;32m 947\u001b[0m )\n\u001b[1;32m 948\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 950\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/io/parsers/readers.py:605\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m 602\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[1;32m 604\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[0;32m--> 605\u001b[0m parser \u001b[38;5;241m=\u001b[39m TextFileReader(filepath_or_buffer, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n\u001b[1;32m 607\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1442\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m 1439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 1441\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 1442\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_engine(f, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mengine)\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1735\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[0;34m(self, f, engine)\u001b[0m\n\u001b[1;32m 1733\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[1;32m 1734\u001b[0m mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1735\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m get_handle(\n\u001b[1;32m 1736\u001b[0m f,\n\u001b[1;32m 1737\u001b[0m mode,\n\u001b[1;32m 1738\u001b[0m encoding\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mencoding\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1739\u001b[0m compression\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompression\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1740\u001b[0m memory_map\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmemory_map\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m),\n\u001b[1;32m 1741\u001b[0m is_text\u001b[38;5;241m=\u001b[39mis_text,\n\u001b[1;32m 1742\u001b[0m errors\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mencoding_errors\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstrict\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[1;32m 1743\u001b[0m storage_options\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstorage_options\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1744\u001b[0m )\n\u001b[1;32m 1745\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1746\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
+ "File \u001b[0;32m~/anaconda3/lib/python3.11/site-packages/pandas/io/common.py:856\u001b[0m, in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m 851\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 852\u001b[0m \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[1;32m 853\u001b[0m \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[1;32m 854\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[1;32m 855\u001b[0m \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[0;32m--> 856\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(\n\u001b[1;32m 857\u001b[0m handle,\n\u001b[1;32m 858\u001b[0m ioargs\u001b[38;5;241m.\u001b[39mmode,\n\u001b[1;32m 859\u001b[0m encoding\u001b[38;5;241m=\u001b[39mioargs\u001b[38;5;241m.\u001b[39mencoding,\n\u001b[1;32m 860\u001b[0m errors\u001b[38;5;241m=\u001b[39merrors,\n\u001b[1;32m 861\u001b[0m newline\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 862\u001b[0m )\n\u001b[1;32m 863\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 864\u001b[0m \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[1;32m 865\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
+ "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/kaggle/input/spain/prices/ACS.csv'"
+ ]
+ }
+ ],
+ "source": [
+ "nRowsRead = 1000 # specify 'None' if want to read whole file\n",
+ "# ACS.csv may have more rows in reality, but we are only loading/previewing the first 1000 rows\n",
+ "df2 = pd.read_csv('/kaggle/input/spain/prices/ACS.csv', delimiter=',', nrows = nRowsRead)\n",
+ "df2.dataframeName = 'ACS.csv'\n",
+ "nRow, nCol = df2.shape\n",
+ "print(f'There are {nRow} rows and {nCol} columns')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.022232,
+ "end_time": "2021-02-09T01:12:31.175756",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.153524",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Let's take a quick look at what the data looks like:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:31.224102Z",
+ "iopub.status.busy": "2021-02-09T01:12:31.223491Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.239409Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.239861Z"
+ },
+ "papermill": {
+ "duration": 0.041808,
+ "end_time": "2021-02-09T01:12:31.240037",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.198229",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "df2.head(5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.022341,
+ "end_time": "2021-02-09T01:12:31.285067",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.262726",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Distribution graphs (histogram/bar graph) of sampled columns:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:31.334109Z",
+ "iopub.status.busy": "2021-02-09T01:12:31.333515Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.349253Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.349708Z"
+ },
+ "papermill": {
+ "duration": 0.042092,
+ "end_time": "2021-02-09T01:12:31.349866",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.307774",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotPerColumnDistribution(df2, 10, 5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.023045,
+ "end_time": "2021-02-09T01:12:31.395690",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.372645",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Correlation matrix:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:31.446015Z",
+ "iopub.status.busy": "2021-02-09T01:12:31.445441Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.839316Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.837922Z"
+ },
+ "papermill": {
+ "duration": 0.420338,
+ "end_time": "2021-02-09T01:12:31.839513",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.419175",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotCorrelationMatrix(df2, 8)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.024132,
+ "end_time": "2021-02-09T01:12:31.888282",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.864150",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Scatter and density plots:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:31.948856Z",
+ "iopub.status.busy": "2021-02-09T01:12:31.948215Z",
+ "iopub.status.idle": "2021-02-09T01:12:34.002484Z",
+ "shell.execute_reply": "2021-02-09T01:12:34.002987Z"
+ },
+ "papermill": {
+ "duration": 2.090238,
+ "end_time": "2021-02-09T01:12:34.003197",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:31.912959",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotScatterMatrix(df2, 15, 10)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.031439,
+ "end_time": "2021-02-09T01:12:34.065804",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.034365",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "### Let's check 3rd file: /kaggle/input/spain/prices/ALFAA.csv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:34.133836Z",
+ "iopub.status.busy": "2021-02-09T01:12:34.133192Z",
+ "iopub.status.idle": "2021-02-09T01:12:34.145777Z",
+ "shell.execute_reply": "2021-02-09T01:12:34.145224Z"
+ },
+ "papermill": {
+ "duration": 0.048953,
+ "end_time": "2021-02-09T01:12:34.145940",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.096987",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "nRowsRead = 1000 # specify 'None' if want to read whole file\n",
+ "# ALFAA.csv may have more rows in reality, but we are only loading/previewing the first 1000 rows\n",
+ "df3 = pd.read_csv('/kaggle/input/spain/prices/ALFAA.csv', delimiter=',', nrows = nRowsRead)\n",
+ "df3.dataframeName = 'ALFAA.csv'\n",
+ "nRow, nCol = df3.shape\n",
+ "print(f'There are {nRow} rows and {nCol} columns')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.031551,
+ "end_time": "2021-02-09T01:12:34.209385",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.177834",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Let's take a quick look at what the data looks like:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:34.290196Z",
+ "iopub.status.busy": "2021-02-09T01:12:34.289249Z",
+ "iopub.status.idle": "2021-02-09T01:12:34.294572Z",
+ "shell.execute_reply": "2021-02-09T01:12:34.293987Z"
+ },
+ "papermill": {
+ "duration": 0.053625,
+ "end_time": "2021-02-09T01:12:34.294729",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.241104",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "df3.head(5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.032956,
+ "end_time": "2021-02-09T01:12:34.360063",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.327107",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Distribution graphs (histogram/bar graph) of sampled columns:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:34.432083Z",
+ "iopub.status.busy": "2021-02-09T01:12:34.431248Z",
+ "iopub.status.idle": "2021-02-09T01:12:34.442906Z",
+ "shell.execute_reply": "2021-02-09T01:12:34.442373Z"
+ },
+ "papermill": {
+ "duration": 0.050518,
+ "end_time": "2021-02-09T01:12:34.443071",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.392553",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotPerColumnDistribution(df3, 10, 5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.032376,
+ "end_time": "2021-02-09T01:12:34.508424",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.476048",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Correlation matrix:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:34.584671Z",
+ "iopub.status.busy": "2021-02-09T01:12:34.583694Z",
+ "iopub.status.idle": "2021-02-09T01:12:34.910404Z",
+ "shell.execute_reply": "2021-02-09T01:12:34.909864Z"
+ },
+ "papermill": {
+ "duration": 0.369464,
+ "end_time": "2021-02-09T01:12:34.910543",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.541079",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotCorrelationMatrix(df3, 8)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.03323,
+ "end_time": "2021-02-09T01:12:34.976937",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:34.943707",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Scatter and density plots:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:35.054831Z",
+ "iopub.status.busy": "2021-02-09T01:12:35.053880Z",
+ "iopub.status.idle": "2021-02-09T01:12:36.971582Z",
+ "shell.execute_reply": "2021-02-09T01:12:36.972108Z"
+ },
+ "papermill": {
+ "duration": 1.961725,
+ "end_time": "2021-02-09T01:12:36.972312",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:35.010587",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "plotScatterMatrix(df3, 15, 10)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.03586,
+ "end_time": "2021-02-09T01:12:37.045275",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:37.009415",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "## Conclusion\n",
+ "This concludes your starter analysis! To go forward from here, click the blue \"Fork Notebook\" button at the top of this kernel. This will create a copy of the code and environment for you to edit. Delete, modify, and add code as you please. Happy Kaggling!"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.5"
+ },
+ "papermill": {
+ "default_parameters": {},
+ "duration": 14.515194,
+ "end_time": "2021-02-09T01:12:37.694830",
+ "environment_variables": {},
+ "exception": null,
+ "input_path": "__notebook__.ipynb",
+ "output_path": "__notebook__.ipynb",
+ "parameters": {},
+ "start_time": "2021-02-09T01:12:23.179636",
+ "version": "2.2.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 4
+}
diff --git a/Spanish stocks/Spanish stocks.ipynb b/Spanish stocks/Spanish stocks.ipynb
new file mode 100644
index 00000000..ffbc35ce
--- /dev/null
+++ b/Spanish stocks/Spanish stocks.ipynb
@@ -0,0 +1,1186 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:29.357781Z",
+ "iopub.status.busy": "2021-02-09T01:12:29.357024Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.307435Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.306436Z"
+ },
+ "papermill": {
+ "duration": 0.976147,
+ "end_time": "2021-02-09T01:12:30.307704",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:29.331557",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "from mpl_toolkits.mplot3d import Axes3D\n",
+ "from sklearn.preprocessing import StandardScaler\n",
+ "import matplotlib.pyplot as plt # plotting\n",
+ "import numpy as np # linear algebra\n",
+ "import os # accessing directory structure\n",
+ "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.390896Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.390243Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.446354Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.445695Z"
+ },
+ "papermill": {
+ "duration": 0.080434,
+ "end_time": "2021-02-09T01:12:30.446517",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.366083",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PQR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BIOS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TLGO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NXTE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTEM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YORS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRLS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FAE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MEDC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CASHP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YHAB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRKM3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/A3M.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VID.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBES.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VIS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YORE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CCEP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EBRO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YEPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MASM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FLUI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SLRS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IDR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/DIDA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MRL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLNX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YMRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ORY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SGREN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TEF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TVAZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSCI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SABE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NATR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LOG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BAINS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/QBT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LLN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BME.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SECU.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YISC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPR3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPSNA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTRA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YCPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SAN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MDF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IKM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRLSbn.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/UBS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GIGAH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PETR3.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/XNOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALNTA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YFID.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AZK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YENT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GCO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/DOMI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EBI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YMHRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TUBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AEDAS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGOP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AMA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PROE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBAR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IBG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRPP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AENA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CATN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BDL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELTB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGOB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELZZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RBT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NEA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAC1.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAML.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MVC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YATO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ACX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RLIA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PETR4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/OLEO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ITX.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ISUR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LRES.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAP67.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/INC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/COL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSRR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CAF.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YABA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CLRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/USIO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKIA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NTGY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENAG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ECR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VTSG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CMIG4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YZBL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ZOT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MCM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MTS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YTOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALFAA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NHH.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRIO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IMGI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YURO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MTBA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YEXR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EESP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SPSL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BRPO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CABK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GGBR4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RJFE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SNCE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ALM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MONIB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EZEN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MAP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GEST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TL5.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AMXL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FER.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOZ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SPK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGMP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELTO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BKY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CCMC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ROVI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GREG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TUR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABGek.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PANGO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRIE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YOVA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ANA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APAM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LGT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FACE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ACS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CMM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YSPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YQPQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/HOME.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CDRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RTA4.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EUWT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ENOR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EKTL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/LBK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PRIM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CPLE6.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EATP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PHMR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CEV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YPARK.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YDOM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADXR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/USIM5.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/IFFE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ABBO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GRN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/UNI.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GSJ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PSG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ICAG.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AGIL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/TR1.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/SCYR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/MEL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ADLB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ATRY.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CRBHO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YQUO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/BBDC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/RDM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/GALQ.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YGGC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VALO.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/OHL.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ARM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/EDRE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVIT.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CIEA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/FCC.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YARE.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/ELEKTRA.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/REN.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YARP.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YAST.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YVIV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/CBAV.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/NBIB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/AIR.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/VOLB.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/YNUM.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/APPS.csv\n",
+ "/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices/PRS.csv\n"
+ ]
+ }
+ ],
+ "source": [
+ "for dirname, _, filenames in os.walk('/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/prices'):\n",
+ " for filename in filenames:\n",
+ " print(os.path.join(dirname, filename))\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.539004Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.538346Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.541456Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.540840Z"
+ },
+ "papermill": {
+ "duration": 0.033336,
+ "end_time": "2021-02-09T01:12:30.541610",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.508274",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Distribution graphs (histogram/bar graph) of column data\n",
+ "def plotPerColumnDistribution(df, nGraphShown, nGraphPerRow):\n",
+ " nunique = df.nunique()\n",
+ " df = df[[col for col in df if nunique[col] > 1 and nunique[col] < 50]] # For displaying purposes, pick columns that have between 1 and 50 unique values\n",
+ " nRow, nCol = df.shape\n",
+ " columnNames = list(df)\n",
+ " nGraphRow = (nCol + nGraphPerRow - 1) / nGraphPerRow\n",
+ " plt.figure(num = None, figsize = (6 * nGraphPerRow, 8 * nGraphRow), dpi = 80, facecolor = 'w', edgecolor = 'k')\n",
+ " for i in range(min(nCol, nGraphShown)):\n",
+ " plt.subplot(nGraphRow, nGraphPerRow, i + 1)\n",
+ " columnDf = df.iloc[:, i]\n",
+ " if (not np.issubdtype(type(columnDf.iloc[0]), np.number)):\n",
+ " valueCounts = columnDf.value_counts()\n",
+ " valueCounts.plot.bar()\n",
+ " else:\n",
+ " columnDf.hist()\n",
+ " plt.ylabel('counts')\n",
+ " plt.xticks(rotation = 90)\n",
+ " plt.title(f'{columnNames[i]} (column {i})')\n",
+ " plt.tight_layout(pad = 1.0, w_pad = 1.0, h_pad = 1.0)\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.590625Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.589989Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.593518Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.592998Z"
+ },
+ "papermill": {
+ "duration": 0.032108,
+ "end_time": "2021-02-09T01:12:30.593653",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.561545",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Correlation matrix\n",
+ "def plotCorrelationMatrix(df, graphWidth):\n",
+ " filename = df.dataframeName\n",
+ " df = df.dropna('columns') # drop columns with NaN\n",
+ " df = df[[col for col in df if df[col].nunique() > 1]] # keep columns where there are more than 1 unique values\n",
+ " if df.shape[1] < 2:\n",
+ " print(f'No correlation plots shown: The number of non-NaN or constant columns ({df.shape[1]}) is less than 2')\n",
+ " return\n",
+ " corr = df.corr()\n",
+ " plt.figure(num=None, figsize=(graphWidth, graphWidth), dpi=80, facecolor='w', edgecolor='k')\n",
+ " corrMat = plt.matshow(corr, fignum = 1)\n",
+ " plt.xticks(range(len(corr.columns)), corr.columns, rotation=90)\n",
+ " plt.yticks(range(len(corr.columns)), corr.columns)\n",
+ " plt.gca().xaxis.tick_bottom()\n",
+ " plt.colorbar(corrMat)\n",
+ " plt.title(f'Correlation Matrix for {filename}', fontsize=15)\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "_kg_hide-input": true,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.644753Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.643664Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.647316Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.646788Z"
+ },
+ "papermill": {
+ "duration": 0.033954,
+ "end_time": "2021-02-09T01:12:30.647489",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.613535",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "# Scatter and density plots\n",
+ "def plotScatterMatrix(df, plotSize, textSize):\n",
+ " df = df.select_dtypes(include =[np.number]) # keep only numerical columns\n",
+ " # Remove rows and columns that would lead to df being singular\n",
+ " df = df.dropna('columns')\n",
+ " df = df[[col for col in df if df[col].nunique() > 1]] # keep columns where there are more than 1 unique values\n",
+ " columnNames = list(df)\n",
+ " if len(columnNames) > 10: # reduce the number of columns for matrix inversion of kernel density plots\n",
+ " columnNames = columnNames[:10]\n",
+ " df = df[columnNames]\n",
+ " ax = pd.plotting.scatter_matrix(df, alpha=0.75, figsize=[plotSize, plotSize], diagonal='kde')\n",
+ " corrs = df.corr().values\n",
+ " for i, j in zip(*plt.np.triu_indices_from(ax, k = 1)):\n",
+ " ax[i, j].annotate('Corr. coef = %.3f' % corrs[i, j], (0.8, 0.2), xycoords='axes fraction', ha='center', va='center', size=textSize)\n",
+ " plt.suptitle('Scatter and Density Plot')\n",
+ " plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.019925,
+ "end_time": "2021-02-09T01:12:30.688183",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.668258",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Now you're ready to read in the data and use the plotting functions to visualize the data."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.020058,
+ "end_time": "2021-02-09T01:12:30.728410",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.708352",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "### Let's check 1st file: /kaggle/input/spain/stocks_list.csv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.774243Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.773525Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.793418Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.792821Z"
+ },
+ "papermill": {
+ "duration": 0.045318,
+ "end_time": "2021-02-09T01:12:30.793580",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.748262",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "There are 234 rows and 7 columns\n"
+ ]
+ }
+ ],
+ "source": [
+ "nRowsRead = 1000 # specify 'None' if want to read whole file\n",
+ "# stocks_list.csv may have more rows in reality, but we are only loading/previewing the first 1000 rows\n",
+ "df1 = pd.read_csv('/Users/shikarichacha/Desktop/air 1/Spanish stocks/spain/stocks_list.csv', delimiter=',', nrows = nRowsRead)\n",
+ "df1.dataframeName = 'stocks_list.csv'\n",
+ "nRow, nCol = df1.shape\n",
+ "print(f'There are {nRow} rows and {nCol} columns')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.020594,
+ "end_time": "2021-02-09T01:12:30.835230",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.814636",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Let's take a quick look at what the data looks like:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.884573Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.883881Z",
+ "iopub.status.idle": "2021-02-09T01:12:30.905952Z",
+ "shell.execute_reply": "2021-02-09T01:12:30.905295Z"
+ },
+ "papermill": {
+ "duration": 0.049819,
+ "end_time": "2021-02-09T01:12:30.906106",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.856287",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Unnamed: 0 | \n",
+ " country | \n",
+ " name | \n",
+ " full_name | \n",
+ " isin | \n",
+ " currency | \n",
+ " symbol | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 0 | \n",
+ " spain | \n",
+ " ACS | \n",
+ " ACS Actividades de Construccion y Servicios SA | \n",
+ " ES0167050915 | \n",
+ " EUR | \n",
+ " ACS | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1 | \n",
+ " spain | \n",
+ " Abengoa | \n",
+ " Abengoa | \n",
+ " ES0105200416 | \n",
+ " EUR | \n",
+ " ABG | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2 | \n",
+ " spain | \n",
+ " Atresmedia | \n",
+ " Atresmedia | \n",
+ " ES0109427734 | \n",
+ " EUR | \n",
+ " A3M | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 3 | \n",
+ " spain | \n",
+ " Acerinox | \n",
+ " Acerinox | \n",
+ " ES0132105018 | \n",
+ " EUR | \n",
+ " ACX | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 4 | \n",
+ " spain | \n",
+ " BBVA | \n",
+ " BBVA | \n",
+ " ES0113211835 | \n",
+ " EUR | \n",
+ " BBVA | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Unnamed: 0 country name \\\n",
+ "0 0 spain ACS \n",
+ "1 1 spain Abengoa \n",
+ "2 2 spain Atresmedia \n",
+ "3 3 spain Acerinox \n",
+ "4 4 spain BBVA \n",
+ "\n",
+ " full_name isin currency \\\n",
+ "0 ACS Actividades de Construccion y Servicios SA ES0167050915 EUR \n",
+ "1 Abengoa ES0105200416 EUR \n",
+ "2 Atresmedia ES0109427734 EUR \n",
+ "3 Acerinox ES0132105018 EUR \n",
+ "4 BBVA ES0113211835 EUR \n",
+ "\n",
+ " symbol \n",
+ "0 ACS \n",
+ "1 ABG \n",
+ "2 A3M \n",
+ "3 ACX \n",
+ "4 BBVA "
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df1.head(5)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "papermill": {
+ "duration": 0.021446,
+ "end_time": "2021-02-09T01:12:30.948877",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.927431",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "source": [
+ "Distribution graphs (histogram/bar graph) of sampled columns:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "_kg_hide-input": false,
+ "execution": {
+ "iopub.execute_input": "2021-02-09T01:12:30.997384Z",
+ "iopub.status.busy": "2021-02-09T01:12:30.996669Z",
+ "iopub.status.idle": "2021-02-09T01:12:31.015659Z",
+ "shell.execute_reply": "2021-02-09T01:12:31.016100Z"
+ },
+ "papermill": {
+ "duration": 0.045702,
+ "end_time": "2021-02-09T01:12:31.016329",
+ "exception": false,
+ "start_time": "2021-02-09T01:12:30.970627",
+ "status": "completed"
+ },
+ "tags": []
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "