python> link> range () / xrange ()

I'm learning python code for Deep Learning related things called TensorFlow. https://www.tensorflow.org/versions/master/tutorials/mnist/tf/index.html#tensorflow-mechanics-101

http://qiita.com/7of9/items/e184bde61545da9267c5 About range () and xrange () that I was interested in.

http://nonbiri-tereka.hatenablog.com/entry/2014/10/24/102639

xrange is faster, isn't it? Is it because the values are retrieved as needed? However, memory is definitely low in xrange, so use xrange when it consumes a lot of memory.

It seems that the memory usage efficiency is different.

Use xrange.

Recommended Posts

python> link> range () / xrange ()
range and xrange
About python, range ()
About Python, for ~ (range)
python> Link> PyUserInput package |
About "for _ in range ():" in python
python> from six.moves import xrange> Six: Python 2 and 3 compatibility library> python2: xrange () / python3: range ()
solver> Link> Solve Excel Solver with python
Link to get started with python
Python
R / Python coding rule link summary
python> link> from __future__ import absolute_import
Python3> List generation from iterable> list (range (5))
range
[Python] Set the graph range with matplotlib
python> link> strftime () and strptime () behavior / code
Python> link> 2D array initialization and assignment
Effective Python memo Item 10 Enumerate from range
[Introduction to Udemy Python3 + Application] 44. range function
python> link> remove CR, LF>'test string \ n'.rstrip ()
Python http.server did not support Range Request
[Road to intermediate Python] Article link summary