how to get a row of a dataframe with subset columns in python
df.iloc[1:3, 5:7]
                                
                            how to get a row of a dataframe with subset columns in python
df.iloc[1:3, 5:7]
                                
                            python calculated row in dataframe subtract
# Dataframe:
# Class     math score   reading score   writing score           
# Class 1      65                73           74
# Class 2      69                66           64
df.loc['Difference'] = df.apply(lambda x: x["Class 1"] - x["Class 2"])
# Result:
# Class       math score    reading score   writing score         
# Class 1         65               73            74
# Class 2         69               66            64
# Difference      -3                7            10
                                
                            Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us