ipython

Suppress output of object when plotting in ipython

感情迁移 提交于 2020-04-07 15:05:15
问题 Is it possible to suppress the array output when plotting a histogram in ipython?: For example: plt.hist(OIR['Range'], bins, named=True, histtype='bar') outputs/prints the array information before displaying the graph. 回答1: Assign the return value to a variable (which I call _ to indicate it's unused): _ = plt.hist(...) 回答2: just put ; after the code. It works only in ipython-notebook. plt.hist(...); 回答3: You can also add plt.show() : plt.hist(OIR['Range'], bins, named=True, histtype='bar')

Project Juypter In / Out Bracket Notation

允我心安 提交于 2020-04-07 06:48:30
问题 I'm trying to learn how project Juypter works (formerly IPython Notebook) I've very confused by the cell identifier's In[] and Out[] I understand In = an input cell and Out = an output cell, but I'm baffled by the significance of the number within the brackets. What does that signify? It seem very prominent in the output, and I'm really baffled why I can't find any documentation on what that represents, and why it's there. I've been searching for the past hour. Search terms: "ipython notebook

马哥博客作业第三周

混江龙づ霸主 提交于 2020-04-06 18:10:19
Ipython使用 ipython是增强的CPython,尤其是交互式体验。该项目还提供了jupyter notebook,之后分离。 帮助 ? Ipython概述和简介 help(name) 查询指定名称的帮助 obj? 列出对象的详细帮助 obj?? 如果可以,则列出更加详细的帮助 特殊变量 ipython内部提供了非常多的内建变量,或许能用到的如下 _表示第一次输出 __表示倒数第二次输出 ___表示倒数第三次输出 _dh目录历史 _oh输出历史 shell命令 使用 !command 执行shell命令 魔术方法 IPython内置的特殊方法,使用%百分号开头 %开头是line magic %%开头是cell magic,notebook的cell 集合 集合,简称集。由任何个元素构成的集体。高级语言都实现了这个非常重要的数据结构类型。在python中,它是 可变的、无序的、不重复 的元素的集合 初始化 元素性质 去重:在集合中,所有元素必须相异 无序:因为无序,所以 不可索引 可哈希:python集合中的元素必须可以hash,即元素都可以使用内建函数hash ( 目前学过的不可hash类型:list、set、byte array ) 可迭代:set中虽然元素不一样,但元素都可以迭代出来 增加 add(elem) 返回值None #注意只能一次增加一个元素,如果元素存在

Pandas选项和自定义

好久不见. 提交于 2020-04-05 23:10:54
Pandas提供API来自定义其行为的某些方面,大多使用来显示。 API由五个相关函数组成。它们分别是 - get_option() set_option() reset_option() describe_option() option_context() get_option(param) get_option(param)需要一个参数,并返回输出中给出的值 display.max_rows 显示默认值。解释器读取此值并显示此值作为显示上限的行。 import pandas as pd print ("display.max_rows = ", pd.get_option("display.max_rows")) 执行上面示例代码,得到以下结果 - display.max_rows = 60 display.max_columns 显示默认值,解释器读取此值并显示此值作为显示上限的行。 import pandas as pd print ("display.max_columns = ", pd.get_option("display.max_columns")) 执行上面示例代码,得到以下结果 - display.max_columns = 20 set_option(param,value) set_option需要两个参数,并将该值设置为指定的参数值 display

Starting second Jupyter notebook where first left off

强颜欢笑 提交于 2020-03-25 16:05:47
问题 Context: I started teaching myself a few new libraries using Jupyter Lab. I know showing emotion on SO is strictly forbidden and this will get edited, but WOW, Jupyter notebooks are cool! Anyway, I'm taking notes in markdown as I work through code examples. It gave me the idea of writing my own little textbook as I learn. For example, in notebook 1, I talk about (teach myself) linear regression. It take notes on vocabulary, show some mathy formulas then work through some code examples. End

Starting second Jupyter notebook where first left off

喜你入骨 提交于 2020-03-25 16:05:22
问题 Context: I started teaching myself a few new libraries using Jupyter Lab. I know showing emotion on SO is strictly forbidden and this will get edited, but WOW, Jupyter notebooks are cool! Anyway, I'm taking notes in markdown as I work through code examples. It gave me the idea of writing my own little textbook as I learn. For example, in notebook 1, I talk about (teach myself) linear regression. It take notes on vocabulary, show some mathy formulas then work through some code examples. End

Jupyter Notebook 快速入门(上)

回眸只為那壹抹淺笑 提交于 2020-03-25 08:20:14
3 月,跳不动了?>>> 转载的一篇文章,Mark 转载一篇入门帖 本文作者为 Marin Gilles ,他是来自法国的一位物理学博士生,用 Python 开发了自己的物理学模拟框架。本文分为两部分,是 Python 翻译组 成立后的第一篇译文,译者 EarlGrey 。 Jupyter Notebook (此前被称为 IPython notebook )是一个交互式笔记本,支持运行 40 多种编程语言。在本文中,我们将介绍 Jupyter notebook 的主要特性,以及为什么对于希望编写漂亮的交互式文档的人来说是一个强大工具。 在开始使用 notebook 之前,我们先需要安装该库。你可以在 Jupyter 官网 上找到完整的步骤。 译者注:其实只要 pip install jupyter 就可以了 jupyter notebook 运行上面的命令之后,你将看到类似下面这样的输出: [I 20:06:36.367 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret [I 20:06:36.813 NotebookApp] Serving notebooks from local directory: /home/your

用Anaconda3安装TensorFlow教程

戏子无情 提交于 2020-03-24 11:54:59
1. 安装好Anaconda3版本 (1) 注:可以发现最新版本是 Anaconda5 了(没关系,下载就是了) (2) 注意安装anaconda时一定要把环境变量加入windows环境中。要没有勾选,安装完后还有手动加入。而且注意3.4版本是默认不加入anaconda的文件路径到环境变量的。 (3) 安装好了后,运行 开始菜单—>Anaconda3—>Anaconda Prompt conda list 可以看到已经安装了numpy、sympy等常用的包。 2. 安装Tensorflow 有两种方法可以安装: [方法一] cpu版本 : pip install --ignore-installed --upgrade tensorflow [方法二] gpu版本 : pip install --ignore-installed --upgrade tensorflow-gpu 注意gpu版要事先选好并装好CUDA和cuDNN 本文限于篇幅,只总结了方法一的安装流程 方法一:CPU版本 (1) 写这篇文章时,TensorFlow在Windows下已经支持支持Python 3.6版本。 (2) 打开Anaconda Prompt,输入清华仓库镜像,这样更新会快一些: conda config --add channels https://mirrors.tuna.tsinghua

Create language kernels for IPython for a language without ZeroMQ bindings

大城市里の小女人 提交于 2020-03-18 17:15:01
问题 There are some interesting descriptions of writing language kernels to allow a language previously unsupported by IPython to be executed from IPython. In all cases, the kernel creation step involves using the target language's ZeroMQ bindings (since ZeroMQ is a major architectural component of IPython's front-end to kernel communication protocol). In my company, a proprietary language was created a few years ago and is maintained with compilers to bytecode (with a bytecode runner written in C

Create language kernels for IPython for a language without ZeroMQ bindings

蹲街弑〆低调 提交于 2020-03-18 17:13:52
问题 There are some interesting descriptions of writing language kernels to allow a language previously unsupported by IPython to be executed from IPython. In all cases, the kernel creation step involves using the target language's ZeroMQ bindings (since ZeroMQ is a major architectural component of IPython's front-end to kernel communication protocol). In my company, a proprietary language was created a few years ago and is maintained with compilers to bytecode (with a bytecode runner written in C