sweetviz 2.1.0: A Sweet and simple for Data analysis.
pip install sweetviz
Sweetviz is an open-source python library that is built upon pandas profiling, Just like pandas profiling, sweetviz works amazingly with a small and larger dataset.
Only two lines of code are enough to dig out the secrets of data like how many missing values, distinct and with each and every variable.
import sweetviz as sv
import pandas as pd
to read the dataset
df=pd.read_csv('BigMart_train.csv')
here I have used big mart data set to analyze.
my_report=sv.analyzed(df)
Done! Use ‘show’ commands to display/save.
my_report.show_html()
Soon after executing this code, you will receive the message as below mentioned.
"Report SWEETVIZ_REPORT.html was generated! NOTEBOOK/COLAB USERS: the web browser MAY not pop up, regardless, the report IS saved in your notebook/colab files."
opens the web browser to have visual effects little code of lines.
as you see by clicking the specific variable, there you can see all the properties of that variable.
Likewise, for the entire data set, this report is generated for the entire data set for every variable.
Sweetviz is also very good at comparing the two data frames as a check on Train and test data of the big mart sales.
my_report=sv.compare([Train_data,'Trainig Data'],[test_data,'Test_Data'])
after executing this just go and type thismy_report.show_html()
your report is ready, as simple as that.
Installation is quite simple and easy just in your anaconda command prompt pip install sweetviz
.this installation support 3.6+python and pandas0.25.3+.
Issues & fixes: errors such as ModuleNotFoundError:NO module named 'sweetviz
and AttributeError,
if any issues which unable to resolve, then uninstall pip uinstall sweetviz
, sweetviz and reinstall by using the pip
command and try again.
Create the report: The three functions are analyze(), compare(), and compare_intra()
you can find complete details on sweetviz and also check pandas profiling complete documentation
and also have a fun reading post on other Data science topics
***Happy learning and spread your knowledge***