I have a standardized dataset which has floats with this (for example, e+01) tail at the end. I know this is a multiplicator to save such a small number without needing to save many zeros between the comma and the first digit...

When feeding my y data to sklearn.train_test_split it will produce numbers without this (for example, e+01), but only in y_test, not in y_train.

x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.05, random_state=2)

[ 1.7813714 ]]

[[ 1.64936126e+00]
[ 1.56135449e+00]

This should be bad for estimating my validation loss in an ANN, or isn't it? How do I prevent this?


1 Answer 1


The situation is just about print formatting and independent from train_test_split method. For example,

x = np.array([1,2,3,100000.0])

produces the output

[1.e+00 2.e+00 3.e+00 1.e+05]
[1. 2. 3.]

So, if the array you're printing has a large logarithmic interval, python chooses to print the numbers in e+x format. If they're close together, it chooses to print in the usual manner.


Not the answer you're looking for? Browse other questions tagged or ask your own question.