Matplotlib Boxplots | Creating Single and Multiple Boxplots in Python

preview_player
Показать описание
Matplotlib boxplots can be used for a variety of tasks which include: outlier detection, understanding the data range and distribution, and understanding whether the data is skewed. In this video, we take a look at creating basic boxplots with matplotlib, without the need for seaborn or any other high-level libraries.

We also look at creating boxplots of multiple columns with different ranges using a simple Python for loop.

----

Libraries used in this video:

Books I Recommend:
As an Amazon Associate I earn from qualifying purchases. By buying through any of the links below I will earn commission at no extra cost to you.

PYTHON FOR DATA ANALYSIS: Data Wrangling with Pandas, NumPy, and IPython

FUNDAMENTALS OF PETROPHYSICS

PETROPHYSICS: Theory and Practice of Measuring Reservoir Rock and Fluid Transport Properties

WELL LOGGING FOR EARTH SCIENTISTS

GEOLOGICAL INTERPRETATION OF WELL LOGS

-----
Thanks for watching, if you want to connect you can find me at the links below:

Sign up to my newsletter at:

#matplotlib #petrophysics #python #boxplots #welllogs #jupyternotebooks #geoscience
Рекомендации по теме
Комментарии
Автор

We are very lucky to be able to see these useful videos. Thank you Andy🙏🙏

mohammadkeshtkar
Автор

I always know my answer is certain with Andy! Thank you for your great videos, I've learnt a lot from you. You're a genius

johnowusukonduah
Автор

Thank you! I am learning and your videos help a lot! I tried to use your code for my dataset but I faced with an error and do not understand where is the problem. TypeError Traceback (most recent call last)
in <module>
4
5 for i, ax in enumerate(axes.flat):
----> 6 ax.boxplot(data1.iloc[:, i])
7 ax.set_title(data1.columns[i], fontsize=20, fontweight='bold')
8 ax.tick_params(axis='y', labelsize=14)
TypeError: unsupported operand type(s) for +: 'method' and 'float'

annadomas
Автор

after knowing the outlier in the boxplot, what is the python command we could use to remove them from our analysis?

chisoo
Автор

Really nice vedio! please share the original DataFrame you used

balajig
Автор

Hi, Could it be possible that using a box plot and interquartile range may not always be a good idea? for example, the formation can have n number of combinations, and fluid properties may vary too. It may result is a very wide data spread. Could it be possible that a point outside the range might be true and represent a unique rock type? Shouldn't we confirm that from the mud log?

neetish
Автор

Hi Andy, looking at the last exercise using subplots, would this still work if the columns had a different number of data points from each other? I've tried similar to this video except with reading a simple csv file containing a few columns of data, with some columns having more data points than others, and the box plots with less data points (NaN) just don't show up at the end. Is there a way around this? If I plot the data separately or on the same graph (same axis) it has no problem, but only some of the subplots with fewer data points just wouldn't plot at all. Thanks

slee
Автор

Really nice video! Thanks.
It would be great if you could also explain how to interpret the graphics. for instance, what is the meaning of having a lot of outliers in GR Log.

Again, thank you very much.

josedavidbastoaguirre
Автор

Hi Andy, Is there any way to remove the outliers?

iliusmondal
Автор

but it doesnt show me the y and x axis. Does anybody know why that is?

cypherecon
Автор

Hi Andy! I have been trying to make a box plot with a simple break in y-axis and have not been able to. any tips?

alirezarahnama
Автор

I can send you the data and the type of boxplot Im talkig about

sanisalisu
Автор

I liked it so much! Please, keep doing such videos, you're saving my nerves..

sabrinakadirova
Автор

Hi, thanks a lot for the content! I need help with a boxplot... Could you tell me how you can show the points inside the boxplot and annotate a number for each point? I have a dataset only of 49 points

espanolaturitmoint