python> Handling of 2D arrays

Operating environment


CentOS 6.5

I want to handle 2D arrays in python.

reference http://d.hatena.ne.jp/yuheiomori0718/20121207/1354893179

151126a.py


onoff=[
[3, 1, 4, 1, 5],
[2, 7, 1, 8, 2],
[0, 5, 7, 7, 2],
]

print onoff[0][0],
print onoff[0][1],
print onoff[0][2]

print onoff[1][0],
print onoff[1][1],
print onoff[1][2]

print onoff[2][0],
print onoff[2][1],
print onoff[2][2]

Execution result


[toLearn]$ python 151126a.py
3 1 4
2 7 1
0 5 7

Recommended Posts

python> Handling of 2D arrays
Handling of python on mac
Handling of sparse tree-structured attributes (Python)
Handling of JSON files in Python
Introduction of Python
Example of 3D skeleton analysis by Python
Python Error Handling
Basics of Python ①
Basics of python ①
Python exception handling
Copy of python
Bulk replacement of strings in Python arrays
Python timezone handling
Python exception handling
Introduction of Python
[Python] limit axis of 3D graph with Matplotlib
Specifying the range of ruby and python arrays
Solve A ~ D of yuki coder 247 with python
Easy understanding of Python for & arrays (for super beginners)
Summary of frequently used Python arrays (for myself)
[Python] Chapter 02-02 Basics of Python programs (Handling of character strings)
[Data science memorandum] Handling of missing values ​​[python]
[Python] Operation of enumerate
List of python modules
Handling yaml with python
Unification of Python environment
Copy of python preferences
Handling json in python
Basics of Python scraping basics
[python] behavior of argmax
[Python] Binary Acing 2020D
Usage of Python locals ()
the zen of Python
Installation of Python 3.3 rc1
Python, about exception handling
Python decimal point handling
# 4 [python] Basics of functions
Hexadecimal handling in Python 3
Basic knowledge of Python
Sober trivia of python3
Summary of Python arguments
Basics of python: Output
Installation of matplotlib (Python 3.3.2)
Application of Python 3 vars
Various processing of Python
[Python] Chapter 02-06 <Supplement> Basics of Python programs (handling of numerical values)
Python: Diagram of 2D data distribution (kernel density estimation)
Planar skeleton analysis with Python (4) Handling of forced displacement
Sum of multiple numpy arrays (sum)
Manipulating Python character lists (arrays)
[Python] Correct usage of map
Python exception handling (Python learning memo ⑥)
Handling of absolute paths of os.path.join
Acquisition of 3D point cloud with Softbank Pepper (Choregraphe, Python)
Summary of python file operations
Summary of Python3 list operations
Python --Quick start of logging
Recommendation of binpacking library of python
[Small story] [Python] Replace strings in 2D arrays with numbers
[python] Value of function object (?)
Create 3d gif with python3