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

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/.

主站蜘蛛池模板: 万州区| 平湖市| 腾冲县| 长岛县| 旌德县| 宜兰市| 瓮安县| 长宁区| 防城港市| 聂拉木县| 庆阳市| 徐闻县| 山阳县| 无为县| 景东| 连云港市| 长兴县| 永胜县| 同仁县| 葵青区| 双江| 武清区| 舟山市| 开封市| 德钦县| 峨边| 濮阳市| 大竹县| 新津县| 东港市| 宣武区| 荣昌县| 定西市| 会东县| 浦江县| 西藏| 贺州市| 克东县| 房产| 乌兰浩特市| 白山市|