Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to create a subset of a dataframe in python

RAM = [f"RUT1_Azi_{i}" for i in range(10)]
RDP = [f"RUT1_Dtctn_Probb_{i}" for i in range(10)]
RDI = [f"RUT1_Dtctn_ID_{i}" for i in range(10)]
REM = [f"RUT1_Elev_{i}" for i in range(10)]

# made up example with the columns above
cols = RAM + RDP + RDI + REM
nrows = 10
df = pd.DataFrame(np.arange(nrows * len(cols)).reshape(nrows, -1), columns=cols)
subsets = [df[list(subcols)] for subcols in zip(RAM, RDP, RDI, REM)]
Comment

PREVIOUS NEXT
Code Example
Python :: tuple unpacking 
Python :: python own function and map function 
Python :: django or flask 
Python :: how to do the sum of list in python 
Python :: for en python 
Python :: python create nested dictionary 
Python :: how to get a user input in python 
Python :: pygame draw square 
Python :: python script to read qr code 
Python :: how to save python variables locally 
Python :: program in python to print first 10 natural number. 
Python :: on_delete django options 
Python :: how to iterate tuple in python 
Python :: min max code in python 
Python :: How to code a simple rock, paper, scissors game on Python 
Python :: parce que in english 
Python :: Odd number without loop in python 
Python :: what is manage.py 
Python :: -2 in python 
Python :: install python cap 
Python :: python 3.5 release date 
Python :: if something in something python example 
Python :: waitkey in python 
Python :: make guessing game by python 
Python :: [1,2,3,4,5] 
Python :: import CreateAPIView django 
Python :: add border to table in python pptx 
Python :: flask decorator causes views to be named the same thing 
Python :: python openstreetmap multiple latitude 
Python :: how to upgrade pip in cmd 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =