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

Steps involved

Let's look at the process of creating the line chart:

Load and prepare the dataset. We will learn more about how to prepare data in Chapter 4, Data Transformation. For this exercise, all the data is preprocessed.

Import the matplotlib library. It can be done with this command:

import matplotlib.pyplot as plt

3.lot the graph:

plt.plot(df)

4.isplay it on the screen:

plt.show()

Here is the code if we put it all together:

import matplotlib.pyplot as plt

plt.rcParams['figure.figsize'] = (14, 10)
plt.plot(df)

And the plotted graph looks something like this:

In the preceding example, we assume the data is available in the CSV format. In real-life scenarios, the data is mostly available in CSV, JSON, Excel, or XML formats and is mostly disseminated through some standard API. For this series, we assume you are already familiar with pandas and how to read different types of files. If not, it's time to revise pandas. Refer to the pandas documentation for further details: https://pandas-datareader.readthedocs.io/en/latest/.

主站蜘蛛池模板: 凌海市| 嘉荫县| 资兴市| 陇南市| 美姑县| 钦州市| 山东省| 浦东新区| 黑龙江省| 湟中县| 元朗区| 潼关县| 梓潼县| 临夏县| 仁怀市| 招远市| 彩票| 奉节县| 大庆市| 贡觉县| 余干县| 区。| 安仁县| 聂荣县| 都安| 三台县| 汕头市| 马边| 海林市| 浦江县| 什邡市| 临潭县| 彰化市| 板桥市| 九龙城区| 盐源县| 丹棱县| 绥江县| 贵溪市| 信丰县| 西乌|