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

Import the external libraries and set up the plotting environment

  1. Open up the chapter 1 Jupyter Notebook and scroll to the Python Libraries section.

Just like for regular Python scripts, libraries can be imported into the Notebook at any time. It's best practice to put the majority of the packages you use at the top of the file. Sometimes it makes sense to load things midway through the Notebook and that is completely OK.

  1. Run the cells to import the external libraries and set the plotting options:

For a nice Notebook setup, it's often useful to set various options along with the imports at the top. For example, the following can be run to change the figure's appearance to something more aesthetically pleasing than the matplotlib and Seaborn defaults: 

    import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns

# See here for more options:
https://matplotlib.org/users/customizing.html
%config InlineBackend.figure_format='retina'
sns.set() # Revert to matplotlib defaults
plt.rcParams['figure.figsize'] = (9, 6)
plt.rcParams['axes.labelpad'] = 10
sns.set_style("darkgrid")

So far in this book, we've gone over the basics of using Jupyter Notebooks for data science. We started by exploring the platform and finding our way around the interface. Then, we discussed the most useful features, which include tab completion and magic functions. Finally, we introduced the Python libraries we'll be using in this book.

The next section will be very interactive as we perform our first analysis together using the Jupyter Notebook.

主站蜘蛛池模板: 万源市| 淳化县| 河曲县| 葫芦岛市| 杨浦区| 卓资县| 科尔| 三河市| 黄大仙区| 甘泉县| 偃师市| 乐清市| 常熟市| 墨脱县| 惠州市| 万荣县| 潼南县| 神池县| 海丰县| 佛学| 揭西县| 于田县| 阳谷县| 北安市| 祥云县| 沂水县| 泾阳县| 岳普湖县| 安吉县| 阿拉善左旗| 扎鲁特旗| 呼和浩特市| 呼玛县| 会昌县| 石门县| 壤塘县| 伊宁县| 甘洛县| 麦盖提县| 习水县| 若尔盖县|