Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

split list python percent

files = [1,2,3,4,5,6,7,8,9,10]
training = files[:int(len(files)*0.8)] #[1, 2, 3, 4, 5, 6, 7, 8]
validation = files[-int(len(files)*0.1):] #[10]
testing = files[-int(len(files)*0.1):] #[10]
Comment

split list python percent

train, validate, test = np.split(files, [int(len(files)*0.8), int(len(files)*0.9)])
Comment

PREVIOUS NEXT
Code Example
Python :: data types in numpy array 
Python :: add row to dataframe 
Python :: Multiple Function in python with input method 
Python :: async webpage 
Python :: python cursor placement 
Python :: for in print 
Python :: Total processing python 
Python :: what is modulus in python 
Python :: sns swarm plot 
Python :: how to get one record in django 
Python :: clipboard python 
Python :: scrapy get text custom tags 
Python :: remove occurence of character from string python 
Python :: python datetime to unix timestamp 
Python :: display pil image on kivy canvas 
Python :: Python Sum of an array in NumPy 
Python :: python use variable name as string 
Python :: how to address null in python 
Python :: python equivalent of R sample function 
Python :: is str in pzthon 
Python :: python cv2 how to update image 
Python :: how to print python exception message 
Python :: application automation python library 
Python :: how to print a message in python 
Python :: How to change the title of a console app in python 
Python :: www.pd.date_range 
Python :: putting in text in python 
Python :: normalize a group in countplot 
Python :: django many to many post update method via rest 
Python :: python format string with list 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =