0% found this document useful (0 votes)
16 views2 pages

Metasnake-Python-Tips Temp

This document provides a guide for beginners to get started with Python for data-related tasks, covering installation methods using Anaconda and Python.org, as well as basic usage of Jupyter. It includes instructions for creating environments, installing necessary libraries, and using Jupyter commands. Additionally, it offers tips on variable naming and references to Python style guidelines.

Uploaded by

nd ia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Metasnake-Python-Tips Temp

This document provides a guide for beginners to get started with Python for data-related tasks, covering installation methods using Anaconda and Python.org, as well as basic usage of Jupyter. It includes instructions for creating environments, installing necessary libraries, and using Jupyter commands. Additionally, it offers tips on variable naming and references to Python style guidelines.

Uploaded by

nd ia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MetaSnake Tips for Getting Started with Python for Data

Python Basics
This handout will cover Python programming basics for those looking to use Python for data‑related
tasks. Python is a versatile language that is easy to learn and use. Check out store.metasnake.com for
more professional Python and data‑related materials.

Installation - Conda
• Install Anaconda (for Python 3) from anaconda.com/downlaod

• Launch Anaconda Prompt (or terminal) and create an environment:


conda create –name pandasclass python=3.11

• Activate the environment:

conda activate pandasclass

• Install libraries:

conda install jupyterlab pandas seaborn xlrd openpyxl scipy scikit-learn

• Launch Jupyter:

jupyter lab

Installation - Python.org
• Install Python 3

• Launch a terminal or command prompt and create a virtual environment:

$ python3 -m venv env

• Activate virtual environment

• Windows:

1
env/Scripts/activate

• Unix (Mac/Linux):

$ source env/bin/activate

• Install libraries:

$ pip install jupyterlab pandas seaborn xlrd openpyxl scipy scikit-learn

• Launch Jupyter:

$ jupyter lab

Jupyter
• Command Mode:

– a ‑ Above
– b ‑ Below
– CTL-Enter ‑ Run
– c, x, v ‑ Copy, cut, paste
– ii ‑ Interrupt Kernel
– 00 ‑ Restart Kernel (zero two times)

• Edit Mode:

– TAB ‑ Completion
– Shift-TAB ‑ Documentation
– ESC ‑ Back to command mode w/o running
– CTL-Enter ‑ Run

• Hints:

– Add ? to functions and methods to see docs


– Add ?? to functions and methods to see the source
– Use cell magic to control Jupyter
%lsmagic

Variables
• You don't need to declare variables. Just put their name followed by =
• Don't name variables keywords (see help(); keywords)
• Don't name variables built‑ins (see dir(__builtins__))
• See PEP 8 http://legacy.python.org/dev/peps/pep-0008/

Copyright 2024 2

You might also like