{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Open up the 'sensor_geometry' dataset","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-02-12T16:46:40.116287Z","iopub.execute_input":"2023-02-12T16:46:40.118366Z","iopub.status.idle":"2023-02-12T16:46:40.830044Z","shell.execute_reply.started":"2023-02-12T16:46:40.118243Z","shell.execute_reply":"2023-02-12T16:46:40.828782Z"}}},{"cell_type":"code","source":"import pandas as pd \n\ndata = pd.read_csv('/kaggle/input/icecube-neutrinos-in-deep-ice/sensor_geometry.csv')\n\ndisplay(data)","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:27.994778Z","iopub.execute_input":"2023-02-12T17:02:27.995468Z","iopub.status.idle":"2023-02-12T17:02:28.025103Z","shell.execute_reply.started":"2023-02-12T17:02:27.995410Z","shell.execute_reply":"2023-02-12T17:02:28.023217Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We see the positive and negative coordinate. So, let's try to count different variations of 'positive-negative' combinations in x-y-z","metadata":{}},{"cell_type":"markdown","source":"I create lists","metadata":{}},{"cell_type":"code","source":"xpos_ypos_zpos = []\nxpos_ypos_zneg = []\nxpos_yneg_zpos = []\nxneg_ypos_zneg = []\nxneg_ypos_zpos = []\nxneg_yneg_zpos = []\nxpos_yneg_zneg = []\nxneg_yneg_zneg = []","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:28.028350Z","iopub.execute_input":"2023-02-12T17:02:28.029516Z","iopub.status.idle":"2023-02-12T17:02:28.037580Z","shell.execute_reply.started":"2023-02-12T17:02:28.029460Z","shell.execute_reply":"2023-02-12T17:02:28.036056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"I create conditions and fulfill the lists","metadata":{}},{"cell_type":"code","source":"for i in range(len(data)):\n    if data.loc[i,'x']>0 and data.loc[i,'y']>0 and data.loc[i,'z']>0:\n        xpos_ypos_zpos.append(i)\n    elif data.loc[i,'x']>0 and data.loc[i,'y']>0 and data.loc[i,'z']<0:\n        xpos_ypos_zneg.append(i)\n    elif data.loc[i,'x']>0 and data.loc[i,'y']<0 and data.loc[i,'z']>0:\n        xpos_yneg_zpos.append(i)\n    elif data.loc[i,'x']<0 and data.loc[i,'y']>0 and data.loc[i,'z']<0:\n        xneg_ypos_zneg.append(i)\n    elif data.loc[i,'x']<0 and data.loc[i,'y']>0 and data.loc[i,'z']>0:\n        xneg_ypos_zpos.append(i)\n    elif data.loc[i,'x']<0 and data.loc[i,'y']<0 and data.loc[i,'z']>0:\n        xneg_yneg_zpos.append(i)\n    elif data.loc[i,'x']>0 and data.loc[i,'y']<0 and data.loc[i,'z']<0:\n        xpos_yneg_zneg.append(i)\n    elif data.loc[i,'x']<0 and data.loc[i,'y']<0 and data.loc[i,'z']<0:\n        xneg_yneg_zneg.append(i)","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:28.039627Z","iopub.execute_input":"2023-02-12T17:02:28.040420Z","iopub.status.idle":"2023-02-12T17:02:28.552880Z","shell.execute_reply.started":"2023-02-12T17:02:28.040367Z","shell.execute_reply":"2023-02-12T17:02:28.551694Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Let's see","metadata":{}},{"cell_type":"code","source":"print('xpos_ypos_zpos', len(xpos_ypos_zpos))\nprint('xpos_ypos_zneg',len(xpos_ypos_zneg))\nprint('xpos_yneg_zpos',len(xpos_yneg_zpos))\nprint('xneg_ypos_zneg',len(xneg_ypos_zneg))\nprint('xneg_ypos_zpos',len(xneg_ypos_zpos))\nprint('xneg_yneg_zpos',len(xneg_yneg_zpos))\nprint('xpos_yneg_zneg',len(xpos_yneg_zneg))\nprint('xneg_yneg_zneg',len(xneg_yneg_zneg))","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:28.556048Z","iopub.execute_input":"2023-02-12T17:02:28.556468Z","iopub.status.idle":"2023-02-12T17:02:28.564530Z","shell.execute_reply.started":"2023-02-12T17:02:28.556433Z","shell.execute_reply":"2023-02-12T17:02:28.563049Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We see the result between 600-800. That's not unusual, but it seems to me that 'z' is more often negative and 'x' is more often positive.","metadata":{}},{"cell_type":"markdown","source":"Let's see it","metadata":{}},{"cell_type":"code","source":"xpos=[]\nypos=[]\nzpos=[]\n\nfor i in range(len(data)):\n    if data.loc[i,'x']>0:\n        xpos.append(i)\n    if data.loc[i,'y']>0:\n        ypos.append(i)\n    if data.loc[i,'z']>0:\n        zpos.append(i)\n\nprint('xpos:', len(xpos), 'xneg:', 5160-len(xpos))\nprint('ypos:',len(ypos), 'yneg:', 5160-len(ypos))\nprint('zpos:',len(zpos), 'zneg:', 5160-len(zpos))","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:28.566151Z","iopub.execute_input":"2023-02-12T17:02:28.566611Z","iopub.status.idle":"2023-02-12T17:02:28.752857Z","shell.execute_reply.started":"2023-02-12T17:02:28.566572Z","shell.execute_reply":"2023-02-12T17:02:28.751305Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Really. 'z' is more often negative and 'x' is more often positive, and 'y' divide halfway.","metadata":{}},{"cell_type":"markdown","source":"Let's see the sum of the columns.","metadata":{}},{"cell_type":"code","source":"print('the sum of data[x]:', data['x'].sum())\nprint('the sum of data[y]:', data['y'].sum())\nprint('the sum of data[z]:', data['z'].sum())","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:02:28.754225Z","iopub.execute_input":"2023-02-12T17:02:28.754621Z","iopub.status.idle":"2023-02-12T17:02:28.761936Z","shell.execute_reply.started":"2023-02-12T17:02:28.754586Z","shell.execute_reply":"2023-02-12T17:02:28.760599Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Let's see the median","metadata":{}},{"cell_type":"code","source":"print('the median of data[x]:', data['x'].median())\nprint('the median of data[y]:', data['y'].median())\nprint('the median of data[z]:', data['z'].median())","metadata":{"execution":{"iopub.status.busy":"2023-02-12T17:07:21.309232Z","iopub.execute_input":"2023-02-12T17:07:21.309748Z","iopub.status.idle":"2023-02-12T17:07:21.328788Z","shell.execute_reply.started":"2023-02-12T17:07:21.309711Z","shell.execute_reply":"2023-02-12T17:07:21.327172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, we see the most popular neutrino's coordinate here","metadata":{}},{"cell_type":"markdown","source":"![](https://sun9-48.userapi.com/impg/i8K8j5M1up8Qv197iAq4OBdceK3fFu8XPy5uKQ/1VDNM3LLMMc.jpg?size=2560x1286&quality=96&sign=7058f24956df36ca0d0dd49eb8ae02dc&type=album)","metadata":{}}]}