{"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":"!pip install sweetviz\n\n","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:42:49.726987Z","iopub.execute_input":"2022-08-01T09:42:49.727494Z","iopub.status.idle":"2022-08-01T09:43:07.207161Z","shell.execute_reply.started":"2022-08-01T09:42:49.727445Z","shell.execute_reply":"2022-08-01T09:43:07.205726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#import necessary libraries\nimport pandas as pd\nimport numpy as np\nimport sweetviz as sv","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:49:17.265435Z","iopub.execute_input":"2022-08-01T09:49:17.265812Z","iopub.status.idle":"2022-08-01T09:49:17.759209Z","shell.execute_reply.started":"2022-08-01T09:49:17.265781Z","shell.execute_reply":"2022-08-01T09:49:17.757983Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_f=pd.read_csv('../input/tabular-playground-series-aug-2022/test.csv')\ndf_te=pd.read_csv('../input/tabular-playground-series-aug-2022/train.csv')","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:47:09.345318Z","iopub.execute_input":"2022-08-01T09:47:09.345752Z","iopub.status.idle":"2022-08-01T09:47:09.605466Z","shell.execute_reply.started":"2022-08-01T09:47:09.345711Z","shell.execute_reply":"2022-08-01T09:47:09.604554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Information about dataframe\ndf_f.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T08:54:32.855334Z","iopub.execute_input":"2022-08-01T08:54:32.856198Z","iopub.status.idle":"2022-08-01T08:54:32.896584Z","shell.execute_reply.started":"2022-08-01T08:54:32.856170Z","shell.execute_reply":"2022-08-01T08:54:32.895686Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#sataistics about datafarme\ndf_f.info()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T08:55:07.190559Z","iopub.execute_input":"2022-08-01T08:55:07.190931Z","iopub.status.idle":"2022-08-01T08:55:07.231643Z","shell.execute_reply.started":"2022-08-01T08:55:07.190900Z","shell.execute_reply":"2022-08-01T08:55:07.230438Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#to get information about data,total row -20775 and columns-25\ndf_f.shape","metadata":{"execution":{"iopub.status.busy":"2022-08-01T08:55:17.104431Z","iopub.execute_input":"2022-08-01T08:55:17.104957Z","iopub.status.idle":"2022-08-01T08:55:17.114986Z","shell.execute_reply.started":"2022-08-01T08:55:17.104906Z","shell.execute_reply":"2022-08-01T08:55:17.113942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Find no.of null values in dataset,Mainly used for finding null values in eac\ndf_f.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:11:23.849599Z","iopub.execute_input":"2022-08-01T09:11:23.850160Z","iopub.status.idle":"2022-08-01T09:11:23.872443Z","shell.execute_reply.started":"2022-08-01T09:11:23.850118Z","shell.execute_reply":"2022-08-01T09:11:23.870933Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# > **Introduction about Sweetviz**\nSweetviz is an open source python library.\nIt can be used for EDA(EXPLORATORY DATA ANALYSIS) with two lines of code.Output is self contained HTML application.","metadata":{}},{"cell_type":"markdown","source":"Sweetviz provides 3 report types:\n1.compare:-used to comapre two datasets,train and test\n2.analyze-Only one dataset","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Comparison_report=sv.compare([df_f,\"Train\"],[df_te,\"Test\"])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:49:31.875679Z","iopub.execute_input":"2022-08-01T09:49:31.876453Z","iopub.status.idle":"2022-08-01T09:50:04.055369Z","shell.execute_reply.started":"2022-08-01T09:49:31.876400Z","shell.execute_reply":"2022-08-01T09:50:04.053948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Once you installed sweetviz,you just need to import the module using two steps:\n1. Create a DataframeReport object using one of: analyze(), compare() or compare_intra()\n2. Use a show_xxx() function to render the report. You can now use either html or notebook report options, as well as apply scaling.","metadata":{}},{"cell_type":"code","source":"# Step 2: Show the report\n# The report can be output as a standalone HTML file, OR embedded in this notebook.\n# For notebooks, we can specify the width, height of the window, as well as scaling of the report itself.\n#Comparison_report.show_notebook() # Using the default values (w=\"100%\", h=750, layout=\"vertical\"), \nComparison_report.show_notebook(layout='vertical', w=1500, h=300, scale=0.7)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T09:54:47.349998Z","iopub.execute_input":"2022-08-01T09:54:47.350423Z","iopub.status.idle":"2022-08-01T09:54:47.461911Z","shell.execute_reply.started":"2022-08-01T09:54:47.350386Z","shell.execute_reply":"2022-08-01T09:54:47.460577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n#To produce the output as HTML\nComparison_report.show_html()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:00:45.121408Z","iopub.execute_input":"2022-08-01T10:00:45.121830Z","iopub.status.idle":"2022-08-01T10:00:45.203579Z","shell.execute_reply.started":"2022-08-01T10:00:45.121798Z","shell.execute_reply":"2022-08-01T10:00:45.201832Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **##2. ANALYSE**","metadata":{}},{"cell_type":"code","source":"analyze_report = sv.analyze([df_f,'Train'],pairwise_analysis=\"on\")\nanalyze_report.show_notebook(w=900, h=450, scale=0.8)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:23:28.724783Z","iopub.execute_input":"2022-08-01T10:23:28.725502Z","iopub.status.idle":"2022-08-01T10:23:46.961355Z","shell.execute_reply.started":"2022-08-01T10:23:28.725452Z","shell.execute_reply":"2022-08-01T10:23:46.960315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Reference\n1. https://pypi.org/project/sweetviz/","metadata":{}}]}