pandas - Select the row and column element of a dataframe and decide the regression variables -
i have pandas dataframe containing 10 columns , 1000 rows. want perform multinomial logit regression. however, want use different independent variable based on choice.
for example, have y "mode chosen" i.e car, bus, train etc. , have attributes of modes x such "car travel time" "bus travel time" etc.
i want perform mnlogit wherein, when chosen mode car, x must car travel time , when chosen mode bus, x must bus travel time. want
if data.mode_chosen == "car": x = data["car travel time"] elif data.mode_chosen == "bus": x = data["bus travel time"] .....
i want access nth row , mth column , find whether car or bus or train , choose dependent variables per choice.
ps: amateur programmer , new forum, kindly let me know if have not made question clear.
Comments
Post a Comment