Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

how to divide 1 dataframe into two based on elements of 1 column

df = pd.DataFrame({'Sales':[10,20,30,40,50], 'A':[3,4,7,6,1]})
print (df)
   A  Sales
0  3     10
1  4     20
2  7     30
3  6     40
4  1     50

s = 30

df1 = df[df['Sales'] >= s]
print (df1)
   A  Sales
2  7     30
3  6     40
4  1     50

df2 = df[df['Sales'] < s]
print (df2)
   A  Sales
0  3     10
1  4     20
Comment

PREVIOUS NEXT
Code Example
Typescript :: material dialog disable close 
Typescript :: test coverage techniques 
Typescript :: how to list elements of an array C# 
Typescript :: styled components gatsby 
Typescript :: mui styled typescript 
Typescript :: class in typescript 
Typescript :: use of value_counts in python 
Typescript :: how to create multiple sheets in excel using python in openpyxml 
Typescript :: ng2003 
Typescript :: java login attempts using for loop 
Typescript :: how to take union of two lists in python 
Typescript :: IM DEAD 
Typescript :: reorder inline-block elements css 
Typescript :: Display Popular Posts laravel 
Typescript :: import dropdown module p-dropdown 
Typescript :: Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead in React/ant design [antd] 
Typescript :: get all products woocommerce with sql 
Typescript :: python double check if wants to execute funtion 
Typescript :: does pure water contain natturaly occuring minerals? 
Typescript :: Algebra is simply overlaying sets of equations onto the world around us. 
Typescript :: how to print selected elements from a list 
Typescript :: develop an algorithm that prints 2 numbers so that one is a multiple of the other 
Typescript :: react native websocket disconnect handler 
Typescript :: laravel orm fetures 
Typescript :: alternative for .include in typescript 
Typescript :: compare 2 sets python 
Typescript :: spade operator typescript 
Typescript :: Jane and the Frost Giants "c++" 
Typescript :: check if breckets clossing properly 
Typescript :: loading assets in ionic react 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =