{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.\n%matplotlib inline\n\n\nmeta_data = pd.read_csv('../input/training_set_metadata.csv')\ntest_meta_data = pd.read_csv('../input/test_set_metadata.csv')","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-output":true,"_uuid":"1068c7fdf3dc89c573878e06273583fcdc9a650b"},"cell_type":"markdown","source":"To gather information of redshift (both photoz and specz), we select out the redshift == 0 (which probably are in our Milky Way)."},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"galactic_cut = meta_data['hostgal_specz'] == 0\ntest_galactic_cut = test_meta_data['hostgal_photoz'] == 0\n\n\n\n","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"da0436fb6ee26f36547750184e9a388dcdab9024"},"cell_type":"markdown","source":"Plotting the redshift distribution of meta_data (training_set)"},{"metadata":{"trusted":true,"_uuid":"b163b08b5d05c1d23d8bd2d23b33b8320f0c82b4"},"cell_type":"code","source":"plt.hist(meta_data[~galactic_cut][\"hostgal_photoz\"], 14, (0, 3.2))\nplt.xlabel(\"redshift(photo_z)\")\nplt.ylabel(\"counts\")\nplt.show()\n\nplt.hist(meta_data[~galactic_cut][\"hostgal_specz\"], 14, (0, 3.2))\nplt.xlabel(\"redshift(spec_z)\")\nplt.ylabel(\"counts\")\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"7fc5998e571960f70de8454c3a3529112c2cfaca"},"cell_type":"markdown","source":"Plotting the redshift distribution of test_meta_data, we can see some difference from the meta_data (training_set)"},{"metadata":{"trusted":true,"_uuid":"9c7119c7aa8c9fe619772a1ebead784bc1cfa8a7"},"cell_type":"code","source":"plt.hist(test_meta_data[~test_galactic_cut][\"hostgal_photoz\"], 14, (0, 3.2))\nplt.xlabel(\"redshift(photo_z)\")\nplt.ylabel(\"counts\")\nplt.show()\n\nplt.hist(test_meta_data[~test_galactic_cut][\"hostgal_specz\"], 14, (0, 3.2))\nplt.xlabel(\"redshift(spec_z)\")\nplt.ylabel(\"counts\")\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"8631cb55e396a3a32fe37b61606e1c8fa7f4c819"},"cell_type":"markdown","source":"This would give us information, that most of the high redshift objects would be class 88 or 95."},{"metadata":{"trusted":true,"_uuid":"92ca0ba2d98c2cad43e7496ff2a390b7c796126d"},"cell_type":"code","source":"#meta_data[meta_data[\"hostgal_photoz\"] > 2.5]\n\nmeta_data[meta_data[\"hostgal_specz\"] > 2]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"5dd93f8a30a38bd5a07488839a2ab5b504ec8259"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}