DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
pandas split dataframe to train and test
train=df.sample(frac=0.8,random_state=200) #random state is a seed value test=df.drop(train.index)
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#pandas
#split
#dataframe
#train
#test
ADD COMMENT
Topic
COMMENT
Name
7+5 =
Submit