Why are variables of train and test data defined using the capital letter (in Python)? I hope this question is the most suitable in this site...

In Python, usually the class name is defined using the capital letter as its first character, for example

class Vehicle:
    ...


However, in machine learning field, often times train and test data are defined as X and Y - not x and y. For example, I'm now reading this tutorial on Keras, but it uses the X and Y as its variables:

from sklearn import datasets

mnist = datasets.load_digits()
X = mnist.data
Y = mnist.target


Why are these defined as capital letters? Is there any convention (at least in Python) among machine learning field that it is better to use the capital letter to define these variables?

Or maybe do people distinguish the upper vs lower case variables in machine learning?

In fact the same tutorial later distinguish these variables like the following:

from sklearn.cross_validation import train_test_split

train_X, test_X, train_y, test_y = train_test_split(X, Y, train_size=0.7, random_state=0)
The X (and sometimes Y) variables are matrices.

In some math notation, it is common practice to write vector variable names as lower case and matrix variable names as upper case. Often these are in bold or have other annotation, but that does not translate well to code. Either way, I believe that the practice has transferred from this notation. 

You may also notice in code, when the target variable is a single column of values, it is written y, so you have X, y

Of course, this has no special semantic meaning in Python and you are free to ignore the convention. However, because it has become a convention, it may be worth maintaining if you share your code.