Replies: 2 comments
-
That's a good question. The "r" here in front of a string is a Python thing. It means that it treats the string as it is -- I think some Windows users require it due to how slashes are treated. Personally, I never need to use it on Linux or macOS. |
Beta Was this translation helpful? Give feedback.
-
Ok, Thanks so much for this. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am just wanting to get some clarification on this function.
I have some code found elsewhere, and its usage is different than the documentation here on github for mlxtend library.
Here is the code:
#-- Import the picture of digits
#-- download dataset from http://yann.lecun.com/exdb/mnist/
from mlxtend.data import loadlocal_mnist
x_train, y_train = loadlocal_mnist(r'data\train-images-idx3-ubyte', r'data\train-labels-idx1-ubyte')
x_test, y_test = loadlocal_mnist(r'data\t10k-images-idx3-ubyte', r'data\t10k-labels-idx1-ubyte')
It is this syntax of the letter 'r' in : r'data\train-images-idx3-ubyte'
I am wondering if this is syntax for Linux, where the 'r' stands for "set Read Permission on the directory"
OR
Does it just mean "Read operation for specifying the mode for the file".
Hope someone can clarify, because I don't see this in the documentation.
Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions