官术网_书友最值得收藏!

Summary

We finished covering most of the basics, such as functions, arguments, and properties for data visualization, based on the matplotlib library. We hope that, through the examples, you will be able to understand and apply them to your own problems. In general, to visualize data, we need to consider five steps- that is, getting data into suitable Python or Pandas data structures, such as lists, dictionaries, Series, or DataFrames. We explained in the previous chapters, how to accomplish this step. The second step is defining plots and subplots for the data object in question. We discussed this in the figures and subplots session. The third step is selecting a plot style and its attributes to show in the subplots such as: line, bar, histogram, scatter plot, line style, and color. The fourth step is adding extra components to the subplots, like legends, annotations and text. The fifth step is displaying or saving the results.

By now, you can do quite a few things with a dataset; for example, manipulation, cleaning, exploration, and visualization based on Python libraries such as Numpy, Pandas, and matplotlib. You can now combine this knowledge and practice with these libraries to get more and more familiar with Python data analysis.

Practice exercises:

  • Name two real or fictional datasets and explain which kind of plot would best fit the data: line plots, bar charts, scatter plots, contour plots, or histograms. Name one or two applications, where each of the plot type is common (for example, histograms are often used in image editing applications).
  • We only focused on the most common plot types of matplotlib. After a bit of research, can you name a few more plot types that are available in matplotlib?
  • Take one Pandas data structure from Chapter 3, Data Analysis with Pandas and plot the data in a suitable way. Then, save it as a PNG image to the disk.
主站蜘蛛池模板: 海南省| 扎赉特旗| 卓尼县| 炉霍县| 怀安县| 航空| 澜沧| 北辰区| 金昌市| 扶绥县| 二连浩特市| 龙门县| 嘉定区| 曲阳县| 崇州市| 正镶白旗| 长宁县| 兖州市| 隆子县| 渝北区| 于都县| 洛浦县| 咸宁市| 娱乐| 土默特右旗| 邓州市| 井研县| 澳门| 聂拉木县| 尚志市| 新巴尔虎右旗| 界首市| 兴海县| 通道| 稷山县| 玛纳斯县| 门头沟区| 赤峰市| 班玛县| 民乐县| 香格里拉县|