`

ipython basic

 
阅读更多
Introspection
引用

Using a question mark ( ? ) before or after a variable will display some general information about the object

引用
Using ?? will also show the function’s source code if possible:

引用
? has a final usage, which is for searching the IPython namespace in a manner similar to the standard UNIX or Windows command line. A number of characters combined with the wildcard ( * ) will show all names matching the wildcard expression.


Magic Command
%quickref Display the IPython Quick Reference Card
%magic Display detailed documentation for all of the available magic commands
%debug Enter the interactive debugger at the bottom of the last exception traceback
%hist Print command input (and optionally output) history
%pdb Automatically enter debugger after any exception
%paste Execute pre-formatted Python code from clipboard
%cpaste Open a special prompt for manually pasting Python code to be executed
%reset Delete all variables / names defined in interactive namespace
%page OBJECT Pretty print the object and display it through a pager
%run script.py Run a Python script inside IPython
%prun statement Execute statement with cProfile and report the profiler output
%time statement Report the execution time of single statement
%timeit statement Run a statement multiple times to compute an emsemble average execution time. Useful for timing code with very short execution time
%who, %who_ls, %whos Display variables defined in interactive namespace, with varying levels of information / verbosity
%xdel variable Delete a variable and attempt to clear any references to the object in the IPython internals


Matplotlib Integration and Pylab Mode
引用
ipython --pylab


Searching and Reusing the Command History
<Ctrl-P>     <up arrow>
<Ctrl-N>     <down arrow>
<Ctrl-R>

Input and Output Variables
引用
IPython stores references to both the input (the text that you type) and output (the object that is returned) in special variables. The previous two outputs are stored in the _ (one underscore) and __ (two underscores) variables, respectively

引用

Input variables are stored in variables named like _iX , where X is the input line number. For each such input variables there is a corresponding output variable _X . So after input line 27, say, there will be two new variables _27 (for the output) and _i27 for the input.


Logging the Input and Output
引用
IPython is capable of logging the entire console session including input and output.Logging is turned on by typing %logstart, %logoff, %logon, %logstate, and %logstop .


Tips

引用
import some_lib
reload(some_lib)

分享到:
评论

相关推荐

    Mastering Pandas(PACKT,2015)

    It provides a basic introduction to the pandas framework, and takes users through the installation of the library and the IPython interactive environment. Thereafter, you will learn basic as well as ...

    ipython-papershape:基于 paper.js 的形状绘制小部件

    ipython-papershape 基于 paper.js 的形状绘制小部件 安装 pip install . 或用于开发安装 pip install -e . 如果您在使用 pip 时遇到问题,请尝试 python setup.py install 用法 参见examples/basic.ipynb

    lightgbm报错:OSError [WinError 126] 找不到指定的模块-三种方法

    File "&lt;ipython-input-1-bd597743fb90&gt;", line 1, in import lightgbm File "D:\Anaconda3\lib\site-packages\lightgbm\__init__.py", line 8, in from .basic import Booster, Dataset ...... OSError: ...

    Python 查询ip

    2.3 Basic optional dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 Dependencies for IPython.kernel (parallel computing) . . . . . . . . . . . . . . . . . . . . 8...

    Python for Data Analysis 2nd by McKinney 原版pdf

    •Learn basic and advanced features in NumPy (Numerical Python) •Get started with data analysis tools in the pandas library •Use flexible tools to load, clean, transform, merge, and reshape data •...

    用python进行数据分析 第二版 Python for Data Analysis, 2nd Edition

    Learn basic and advanced features in NumPy (Numerical Python) Get started with data analysis tools in the pandas library Use flexible tools to load, clean, transform, merge, and reshape data ...

    options-trading-strategies-in-python-basic

    它包含视频,电子书,MCQ,iPython笔记本文档和交互式编码练习的组合,以增强您的学习体验。 我在这门课程中学到什么期权交易基础编写并分析看跌期权和看涨期权的收益了解波动率在期权交易中如何起重要作用,以及...

    Python Data Science Handbook

    program, and other basic tasks. Instead, it is meant to help Python users learn to use Python’s data science stack—libraries such as IPython, NumPy, Pandas, Matplotlib, Scikit-Learn, and related ...

    Python Data Science Handbook Essential Tools for Working with Data

    program, and other basic tasks. Instead, it is meant to help Python users learn to use Python’s data science stack—libraries such as IPython, NumPy, Pandas, Matplotlib, Scikit-Learn, and related ...

    breadplan:一个简单的Python脚本,可为Tartine Bread中的食谱生成烘焙计划

    用法指令breadplan.py basic生成Basic Country Bread的食谱breadplan.py baguette生成breadplan.py baguette的食谱breadplan.py rye生成黑麦面包的食谱breadplan.py wholewheat生成全麦面包的食谱请注意,目前仅实施...

    python-programmers-artificial-intelligence-studies

    Intro to Data Science sections: AI, basic stats, simulation, animation, random variables, data wrangling, regression AI, big data and cloud data science case studies: NLP, data mining Twitter, IBM ...

    Python for data analysis

    It’s ideal for analysts new to Python and for Python programmers new to scientific computing., Use the IPython interactive shell as your primary development environment, Learn basic and advanced ...

    Python For Data Analysis

    It’s ideal for analysts new to Python and for Python programmers new to scientific computing., Use the IPython interactive shell as your primary development environment, Learn basic and advanced ...

    Python for Data Analysis

    It’s ideal for analysts new to Python and for Python programmers new to scientific computing., Use the IPython interactive shell as your primary development environment, Learn basic and advanced ...

    Python 3.7 is a programming language

    IPython is a powerful interactive shell that features easy editing and recording of a work session, and supports visualizations and parallel computing. The Software Carpentry Course teaches basic ...

    Learning.Data.Mining.with.Python.1784396052

    This book teaches you to design and develop data mining applications using a variety of datasets, starting with basic classification and affinity analysis. Next, we move on to more complex data types ...

    Learning.Boost.Cplusplus.Libraries.1783551216

    This book teaches you to design and develop data mining applications using a variety of datasets, starting with basic classification and affinity analysis. Next, we move on to more complex data types ...

    撬:具有强大的自省功能的运行时开发人员控制台和IRB替代产品

    撬 ... 校友: 康拉德·欧文 瑞安·菲茨杰拉德(Ryan Fitzgerald) ...受IPython,Smalltalk和其他高级REPL启发的许多便捷命令 大量的可提供远程会话,完整的调试功能等。 安装 邦德勒 gem 'pry' , '~&gt;

    Mastering.SciPy.1783984740

    If you are a mathematician, engineer, or computer scientist with a proficiency in Python and familiarity with IPython, this is the book for you. Some basic knowledge of numerical methods in scientific...

Global site tag (gtag.js) - Google Analytics