{"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":"code","source":"import numpy as np\nimport pandas as pd\n\nTRAIN_PATH = \"../input/happy-whale-and-dolphin/train.csv\"\nTARGET1 = \"species\"\nTARGET2 = \"individual_id\"","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-02-13T05:40:11.167630Z","iopub.execute_input":"2022-02-13T05:40:11.168239Z","iopub.status.idle":"2022-02-13T05:40:11.173505Z","shell.execute_reply.started":"2022-02-13T05:40:11.168204Z","shell.execute_reply":"2022-02-13T05:40:11.172643Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(TRAIN_PATH)","metadata":{"execution":{"iopub.status.busy":"2022-02-13T05:40:11.175357Z","iopub.execute_input":"2022-02-13T05:40:11.175844Z","iopub.status.idle":"2022-02-13T05:40:11.263200Z","shell.execute_reply.started":"2022-02-13T05:40:11.175804Z","shell.execute_reply":"2022-02-13T05:40:11.262207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def getLabelCount(df,target):\n    return [( labelValue,len(train.loc[df[target] == labelValue]) ) for labelValue in df[target].unique()]","metadata":{"execution":{"iopub.status.busy":"2022-02-13T05:40:11.264516Z","iopub.execute_input":"2022-02-13T05:40:11.264761Z","iopub.status.idle":"2022-02-13T05:40:11.270347Z","shell.execute_reply.started":"2022-02-13T05:40:11.264731Z","shell.execute_reply":"2022-02-13T05:40:11.269255Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# species count","metadata":{}},{"cell_type":"code","source":"labelCount = getLabelCount(train,TARGET1)\nsorted(labelCount,reverse=True,key=lambda item: item[1])","metadata":{"execution":{"iopub.status.busy":"2022-02-13T05:40:11.272205Z","iopub.execute_input":"2022-02-13T05:40:11.272573Z","iopub.status.idle":"2022-02-13T05:40:11.505368Z","shell.execute_reply.started":"2022-02-13T05:40:11.272496Z","shell.execute_reply":"2022-02-13T05:40:11.504330Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# individual_id count","metadata":{}},{"cell_type":"code","source":"labelCount = getLabelCount(train,TARGET2)\nsorted(labelCount,reverse=True,key=lambda item: item[1])","metadata":{"execution":{"iopub.status.busy":"2022-02-13T05:40:11.508330Z","iopub.execute_input":"2022-02-13T05:40:11.508708Z","iopub.status.idle":"2022-02-13T05:42:15.543651Z","shell.execute_reply.started":"2022-02-13T05:40:11.508659Z","shell.execute_reply":"2022-02-13T05:42:15.542616Z"},"trusted":true},"execution_count":null,"outputs":[]}]}