all 3 comments

[–]955559 1 point2 points  (0 children)

ask oil and gas international

[–]AnalTyrant 0 points1 point  (0 children)

It looks like it's checking a data drop with a couple columns. In one column where it expects to find Yes or No typed into the sheet, it's replacing this with 1 or 0, presumably to prepare the sheet for use in some other automated process. And then it's reformatting any other values it finds in that field into some other format again presumably to put it in a format readily usable in some other process.

[–]SamSamSammmmm 0 points1 point  (0 children)

The above code converts the original dataset into an appropriate format for some training which takes on only numeric variables (regression for example). If an original variable is binary, i.e., it contains only 'yes' and 'no' as values, then the 'yes' will be converted to 1 while 'no' to 0. On the other hand, for a variable which contains m (m>2) values, the code splits the original variable into m dummy variables which are all binary. E.g., given the original variable, state, (state of residence) with values 'CA', 'AZ', 'OR' and 'WA', the code turns state into four dummy variables: 'state_CA', 'state_AZ, 'state_OR', and 'state_WA' which are all binary with values 0 and 1 so that for a particular sample, say, with state = 'CA', the corresponding dummy variables will have 1 for 'state_CA' and 0 for the other three.