Using Python for data analysis--ipython

Source: Internet
Author: User
Tags clear screen python script

Data analysis using Python--ipython one, ipython some common commands

1.TAB Auto-complete
2. Variable +? Show related information
3. Function name +?? The code that can get the function
4. Use the wildcard character * NP. load?
5.%run + file name. PY can execute another script directly
6._ and __ will save the last two output results
7._ix and _x x line numbers will output the input and output of line X

Second, keyboard shortcut keys

1.ctrl+p forward Command
2.ctrl+n back command
3.ctrl+r Search History by row
4.CTRL+C Termination Program
5.ctrl+a cursor moves to the beginning of the line
6.ctrl+e cursor moves to end of line
7.ctrl+u clears all text for the current line
8.ctrl+l Clear Screen

Three, Magic command

1.%paste will execute the code in the Clipboard in the form of an overall execution.
2.%hist Print all the history of the command input
3.%run script.py executes a python script
4.%time Statement report statement execution time
5.%timeit statement report average execution time for statement

Iv. Executing shell commands

1.!cmd go to the shell side of the system to execute CMD
2.%PWD returns the current working directory of the system
3.%dirs returns a list containing the current directory stack
4.%ENV return system environment variables in dict form
5. Start with a command line that says the command needs to be executed in the shell
6.%CD Directory Change System working directory

Five, interactive debugger

1.%debug into Debug
2.Q Exit Debugger
3.b number number line break point

Six, code performance test

1.%time
2.%timeit
3.%prun
4.%run-p

Using Python for data analysis--ipython

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.