Operating environment
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 14.04 LTS desktop amd64
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v8.0
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
I'm trying to read 2D data from a file. I thought about handling it with a 2D array for the future.
Refer to the following for initialization and assignment of 2D array. http://stackoverflow.com/questions/7745562/appending-to-2d-lists-in-python
python_study161223.py
mylist = [[] for idx in range(5)]
mylist[0] = [3, 1]
mylist[2] = [4, 1]
mylist[3] = [5, 9]
print(mylist)
Run
$ python python_study161223.py
[[3, 1], [], [4, 1], [5, 9], []]
Recommended Posts