Category Archives: Uncategorized

Indexing

To better understand how the indexing with a python list works, I tried this.
First, a = [0, 1, 2, 3, 4, 5].
1. a[4:6] gives [4, 5], as I learned before.
2. a[-1:2] gives [].
3. a[-2:] gives [4, 5].
4. a[-5:2] gives [1].
Here is my understanding. The zero and positive numbers counts elements from the left. The negative numbers counts from the right. When we write [ind1:ind2], the element indicated by ind1 should be on the left side of the element pointed by ind2.

Certificate verification and OpenSSL with Python 3.6

I was following A Guide to TF Layers: Building a Convolutional Neural Network. When I excuted

mnist = tf.contrib.learn.datasets.load_dataset("mnist")

I got an error. The last line of the error was

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>

which sounds like some network issue. First, I reached a GitHub page, which directed to another GitHub page. According to the second page, I had to open ReadMe.rtf in the Python 3.6 application folder. It explains the issue regarding OpenSSL and suggests to run Install Certificates.command.