How to choose a part of data for train and test?

Hi everyone
I am new in pytorch. I have a large datafile size. Suppose I want to take 20% data (randomly choosen from the file), out of that 20% I want 75% for training and 25% for testing.
How can I take the 20% data from the original data file ?

U can use train_test_split from sk-learn or u can code it ur self
If u r coding it ur self all u need to do is get the length of ur training data and multiply it by 0.2, after that use np.random.shuffle( ) to shuffle the data and the perform a slice of the shuffled data like this: test_data = data[-splice:]
where splice = int(len(data)*0.2)