{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"collapsed":false},"outputs":[],"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)\n\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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output."},{"cell_type":"code","execution_count":null,"metadata":{"collapsed":false},"outputs":[],"source":"d={ 'Group':[1,1,1,1,1,2,2,2,2,2],\n    'Eng':  [3,6,5,7,4,2,3,4,5,6],\n    'Chem': [5,6,3,2,6,3,6,1,7,1],\n    'Phys': [4,5,2,1,5,1,7,8,9,5]\n}\n\ndf=pd.DataFrame(data=d, columns=['Group', 'Eng', 'Chem', 'Phys'])\n\n#print(df)\n#print('-'*27)\naggr=[]\naggr=df.groupby(['Group']).agg(['min'])\n#print(aggr)\n#print('-'*27)\n#print(df['Group'])\nmath_values=[1,3,4,5,4,5,6,5,4,3]\n#print('*'*27)\ndf.insert(1, 'Math', math_values)\nm='M'\nf='F'\ng=[m,f,m,f,m,f,m,f,m,f]\ndf.insert(1, 'G', g)\nprint(df)\naggr2=df.groupby(['Group','G']).agg(['min'])\nprint('+'*27)\nprint(aggr2)\naggr3=df.groupby(['Group','G']).agg(['max'])\nprint('+'*27)\nprint(aggr3)"}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"nbformat":4,"nbformat_minor":0}