Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

split pandas dataframe in two

df_new1, df_new2 = df[:10, :], df[10:, :] if len(df) > 10 else df, None
Comment

PREVIOUS NEXT
Code Example
Python :: Generate 3 random integers between 100 and 999 which is divisible by 5 
Python :: print random integers 
Python :: python strptime() 
Python :: how to log errors while debug is false in django 
Python :: generate random password django 
Python :: sqlalchemy_database_uri 
Python :: get current function name in python3 
Python :: update ubuntu to python 3.85 
Python :: opencv convert black pixels to white 
Python :: using a dictionary in python 
Python :: method for detect that a float number is integer in python 
Python :: python run curl 
Python :: can only concatenate str (not "int") to str 
Python :: python positional argument follows keyword argument 
Python :: python game 
Python :: pandas add value to excel column and save 
Python :: list files in http directory python 
Python :: flask print request headers 
Python :: How to get the first and last values from the dataframe column using a function 
Python :: python int to bytes 
Python :: confusion matrix for classification 
Python :: add a button on tkinter 
Python :: transform data frame in list 
Python :: python function vs lambda 
Python :: undefined in python 
Python :: how to split a string with newline in python 
Python :: python bubble sort 
Python :: initialize a 2d list python 
Python :: python enum advanced 
Python :: user information in python 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =