`

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)

分享到:
评论

相关推荐

    Basic_io_点云求解dem_

    在本例中,`Basic_io.ipynb`可能包含用于读取点云数据、执行预处理和求解DEM的Python代码和相关可视化。 总结来说,点云求解DEM涉及从原始点云数据的预处理到最终的地形模型生成,这需要对数据处理、滤波、插值算法...

    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

    Python 查询ip

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

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

    Algorithm_Basic

    pdb模块提供了强大的调试工具,而IPython和Jupyter Notebook则提供了可视化实验环境,方便我们逐步分析算法运行过程。 总结,"Algorithm_Basic"涉及的是算法的基础知识和Python实现。从理解算法原理到掌握Python...

    basic-tools

    通过IPython内核,Notebook支持变量探索、函数测试和调试,以及魔术命令(Magic Commands)进行便捷操作,例如 `%timeit` 测量代码执行时间。 6. **版本控制与协作** 使用Git进行版本控制,可以追踪和管理...

    python自学笔记.docx

    除此之外,还有IPython,它是一个增强的交互式Python解释器,提供了一些额外的功能和便利。PyPy是一个用Python语言自身编写的解释器,以快速和高效著称。Jython和IronPython则分别在Java和.NET平台上运行Python代码...

    options-trading-strategies-in-python-basic

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

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

    scipylectures

    - **IPython:** An enhanced interactive Python shell that offers advanced features such as tab completion, history browsing, and an integrated help system. - **Cython:** A compiled language that ...

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

Global site tag (gtag.js) - Google Analytics