Convert categorical data in numeric preserve euclidean distance
If i understand your question correct, you are misusing the word categorical. Categorical is always a 0 or 1 in their respective indices.

for example:

Data - [M, F, M, M]

Categorical Data: [[1, 0], [0, 1], [1, 0], [1, 0]]

If three types of classes are there, then it would be a 3 arrayed input for each datapoint.

If you feel that having the numbers 10 and 20 for Male and Female is meaningful to you, then you can go ahead and use it. There's nothing wrong in that. But when you want to finally train on the Data, say LSTM, it prefers taking in the categorical data.

But if you are talking about the input attributes, then you need not worry about the 0-1 problem, Just use as they are.

Vote up, if you find this helpful ;)