首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Python数据分析(中英对照)·Introduction to Matplotlib and Pyplot-Matplotlib 和 Pyplot 介绍

Matplotlib is a Python plotting library that produces publication-quality figures. Matplotlib是一个Python绘图库,用于生成出版物质量的图形。 It can be used both in Python scripts and when using Python’s interactive mode. 它既可以在Python脚本中使用,也可以在使用Python的交互模式时使用。 Matplotlib is a very large library, and getting to know it well takes time. Matplotlib是一个非常大的库,了解它需要时间。 But often we don’t need the full matplotlib library in our programs,and this is where Pyplot comes in handy. 但是我们的程序中通常不需要完整的matplotlib库,这就是Pyplot的用武之地。 Pyplot is a collection of functions that make matplotlib work like Matlab,which you may be familiar with. Pyplot是一组函数,使matplotlib像Matlab一样工作,您可能熟悉这些函数。 Pyplot is especially useful for interactive work,for example, when you’d like to explore a dataset or visually examine your simulation results. Pyplot对于交互式工作尤其有用,例如,当您希望浏览数据集或直观地检查模拟结果时。 We’ll be using Pyplot in all our data visualizations. 我们将在所有数据可视化中使用Pyplot。 Pyplot provides what is sometimes called a state machine interface to matplotlib library. Pyplot为matplotlib库提供了有时称为状态机的接口。 You can loosely think of it as a process where you create figures one at a time,and all commands affect the current figure and the current plot. 您可以粗略地将其视为一个一次创建一个地物的过程,所有命令都会影响当前地物和当前绘图。 We will mostly use NumPy arrays for storing the data that we’d like to plot, but we’ll occasionally use other types of data objects such as built-in lists. 我们将主要使用NumPy数组来存储要绘制的数据,但偶尔也会使用其他类型的数据对象,如内置列表。 As you may have realized, saying matplotlib.pyplot is kind of a mouthful, and it’s a lot to type too. 正如您可能已经意识到的那样,说matplotlib.pyplot有点口齿不清,而且打字也很费劲。 That’s why virtually everyone who uses the library imports it as plt, which is a lot shorter. 这就是为什么几乎所有使用该库的人都将其作为plt导入,而plt要短得多。 So to import the library, we will type the following– import matplotlib.pyplot as plt. 因此,要导入库,我们将键入以下内容–import matplotlib.pyplot as plt。 Now we are ready to start our plotting. 现在我们准备开始我们的阴谋。 A basis but very useful command is the plt plot function, which can be used to plot lines and markers. plt plot函数是一个基本

03

Jupyter在美团民宿的应用实践

做算法的同学对于Kaggle应该都不陌生,除了举办算法挑战赛以外,它还提供了一个学习、练习数据分析和算法开发的平台。Kaggle提供了Kaggle Kernels,方便用户进行数据分析以及经验分享。在Kaggle Kernels中,你可以Fork别人分享的结果进行复现或者进一步分析,也可以新建一个Kernel进行数据分析和算法开发。Kaggle Kernels还提供了一个配置好的环境,以及比赛的数据集,帮你从配置本地环境中解放出来。Kaggle Kernels提供给你的是一个运行在浏览器中的Jupyter,你可以在上面进行交互式的执行代码、探索数据、训练模型等等。更多关于Kaggle Kernels的使用方法可以参考 Introduction to Kaggle Kernels,这里不再多做阐述。

02

spark入门框架+python

不可否认,spark是一种大数据框架,它的出现往往会有Hadoop的身影,其实Hadoop更多的可以看做是大数据的基础设施,它本身提供了HDFS文件系统用于大数据的存储,当然还提供了MR用于大数据处理,但是MR有很多自身的缺点,针对这些缺点也已经有很多其他的方法,类如针对MR编写的复杂性有了Hive,针对MR的实时性差有了流处理Strom等等,spark设计也是针对MR功能的,它并没有大数据的存储功能,只是改进了大数据的处理部分,它的最大优势就是快,因为它是基于内存的,不像MR每一个job都要和磁盘打交道,所以大大节省了时间,它的核心是RDD,里面体现了一个弹性概念意思就是说,在内存存储不下数据的时候,spark会自动的将部分数据转存到磁盘,而这个过程是对用户透明的。

02
领券