Package: xplotter
:bar_chart: Gathering insights from data in a complete EDA process components :chart_with_upwards_trend:Table of contentAbout xplotterPackage structureFeaturesInstalling the packageExamplesInsights moduleUsage around the worldContributionSocial MediaAbout xplotterThe definition is clear:xplotteris a python library created for making the Exploratory Data Analysis process so much easier! Withxplotter, data scientists and data analysts can use a vast number of functions for plotting, customizing and extracting insights from data with very few lines of code. The exploratory process is a key step on every data science and business inteligence project and it's very important to understand your data before take any action. The use cases are almost infinity!Why use xplotter?Use functions for plotting graphs and extracting information from your data in an easy wayYou can explore your data fasterVisualize some beautiful charts with few lines of codeSave your images in a local repositoryImprove analytics by analysing trends and distributions of your dataRich documentation to explorePackage structureAfter viewing some of benefits of usingxplotterin a data project, it's also important to see how the package was built and how it's organized. At the moment, there are two modules on the xplotter package folder and they are explained on the table below:ModuleDescriptionFunctions/MethodsLines of Code (approx)formatterAuxiliar functions for formatting charts3~150insightsFunctions for exploring data in a wide range of possibilities14~1800FeaturesThe features of xplotter package are built into useful and well-documented functions that can be used in any step of data exploration process. There will be a specific session of usage examples in this documentations but, just be clear, you can use xplotter for a simple formatting step like customizing the border axis in a matplotlib graph...fromxplotter.formatterimportformat_spinesfig,ax=plt.subplots(figsize=(10,7))format_spines(ax,right_border=False)...or even plot a simple and customized countplot with labels already written inside the bars...fromxplotter.insightsimportplot_countplotplot_countplot(df=df,col='cat_column')At this moment, all the features available in the xplotter package are:ModuleFunction/ClassShort Descriptionformatterformat_spinesModify borders and axis colors of matplotlib figureformatterAnnotateBarsMakes the process of labeling data points in a bar chart easierformattermake_autopctHelps labeling data in a pie or donut chartinsightssave_figEasy way for saving figures created inside or outside xplotterinsightsplot_donutchartCreates a custom donut chart for a specific categorical columninsightsplot_pie_chartCreates a custom pie chart for a specific categorical columninsightsplot_double_donut_chartCreates a "double" custom donut chart for two columns of a given datasetinsightsplot_countplotCreates a simple countplot using a dataset and a column nameinsightsplot_pct_countplotCreates a percentage countplot (grouped bar chart) using a dataset and a column nameinsightsplot_distplotCreates a custom distribution plot based on a numeric columninsightsplot_aggregationPlots a custom aggregate chart into a bar styleinsightsplot_cat_aggreg_reportA rich and complete report using count, aggregation and distribution functionsinsightsdata_overviewExtract useful information of a given dataset to offers an overview from the datainsightsplot_corr_matrixA beautiful and customized correlation matrix for a dataset and a target columninsightsplot_multiple_distplotsPlots custom distribution charts for multiple columns at once using the col_list parameterinsightsplot_multiple_dist_scatterplotPlots a rich graph that joins a distribution and a scatterplotinsightsplot_multiple_countplotsPlots multiple formatted countplot based on a list of columns of a given datasetinsightsplot_evolutionplotPlots an evolution plot in a line chartInstalling the packageThe last version ofxplotterpackage are published and available onPyPI repository:pushpin:Note:as a good practice for every Python project, the creation of avirtual environmentis needed to get a full control of dependencies and third part packages on your code. By this way, the code below can be used for creating a new venv on your OS.# Creating and activating venv on Linux$python-mvenv<path_venv>/<name_venv>
$source<path_venv>/<nome_venv>/bin/activate# Creating and activating venv on Windows$python-mvenv<path_venv>/<name_venv>
$<path_venv>/<nome_venv>/Scripts/activateWith the new venv active, all you need is execute the code below using pip for installing xplotter package (upgrading pip is optional):$pipinstall--upgradepip
$pipinstallxplotterThe xplotter package is built in a layer above some other python packages like matplotlib, seaborn and pandas. Because of that, when installing xplotter, the pip utility will also install all dependencies linked to xplotter. The output expected on cmd or terminal are something like:Installing collected packages: six, pytz, python-dateutil, pyparsing, numpy, kiwisolver, cycler, scipy, pandas, matplotlib, seaborn, xplotter
Successfully installed cycler-0.10.0 kiwisolver-1.3.1 matplotlib-3.2.1 numpy-1.20.2 pandas-1.1.5 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2021.1 scipy-1.6.3 seaborn-0.11.1 six-1.15.0 xplotter-0.0.3ExamplesIn this session, you will see some usage examples of xplotter on real problems using data. After installing the package, it's important to know how to use it and how to extract the real power of it.Insights ModuleAs you could see by this time, the insights module from xplotter have a lot of functions that can deliver something like "charts as a code". It's just a funy way to describe how the components and the tools inside this module can make life of a data explorer easier. To ilustrate that, the code below reads the titanic dataset directly from seaborn and plots a custom donut chart forsurvivedfeature.fromxplotter.insightsimportplot_donut_chartimportseabornassnstitanic=seaborn.load_dataset('titanic')plot_donut_chart(df=titanic,col='survived')This outputs the following figure:Another example uses the iris dataset also read from seabornload_dataset()function. In this case, we can use theplot_distplot()xplotter funcion for visualize the distribution of sepal_length feature for each species in a fast and direct way:iris=seaborn.load_dataset('iris')plot_distplot(df=iris,col='sepal_length',hue='species')Let's see the beautiful distribution plot the function above generated for you:There are much more you can do using insights module from xplotter package. It's a hole world to be explore and a bunch of business questions that can be answeared through visualization charts easy plotted through those already coded functions. In the next topic, this documentation will share with you some of real world implementations using xplotter.Usage Around the WorldFor being easy and simple, xplotter can have alot of applications. One of the most famous one is the notebookTitanic Dataset Explorationposted on Kaggle byThiago Panini. This well written notebook uses the insight module for plotting beautiful charts and building a really complete Exploratory Data Analysis proccess and, by now, it achieve abronze medalwith 32 upvotes by Kaggle's community and a incredible mark of more than 1,600 views!ContributionThe xplotter python package is an open source implementation and the more people use it, the more happy the developers will be. So if you want to contribute with xplotter, please feel free to follow the best practices for implementing coding on this github repository through creating new branches, making merge requests and pointig out whenever you think there is a new topic to explore or a bug to be fixed.Thank you very much for reaching this and it will be a pleasure to have you as xplotter user or developer.Social MediaFollow me on LinkedIn:https://www.linkedin.com/in/thiago-panini/See my other Python packages:https://github.com/ThiagoPanini