reset password
Author Message
cs320stu66
Posts: 19
Posted 23:24 Feb 02, 2016 |

Hi, 

I didn't understand this part 2pts: Convert Trans, Drive, Fuel, Veh Class, SmartWay column values to integers.

Trans, Drive, Fuel, Veh Class, SmartWay columns are having String values! Can anyone guide or explain what we should do here?

meishu
Posts: 6
Posted 23:36 Feb 02, 2016 |

Like in the Credit Approval or Income Prediction assignment,

Convert non-numeric columns to columns with an integer representations.

You'll probably want to enumerate all possible values for each column and then munge those columns with a mapping from that enumeration.

msargent
Posts: 519
Posted 10:39 Feb 03, 2016 |

Consider, if you are stuck, using the Pandas' unique function to get all the different values. Another way is to use Pandas' factorize method --- see here http://www.ultravioletanalytics.com/2014/11/05/kaggle-titanic-competition-part-iii-variable-transformations/

Last edited by msargent at 10:45 Feb 03, 2016.
cs320stu66
Posts: 19
Posted 11:37 Feb 03, 2016 |

Thank you Professor. I will look at that now.

ringworld
Posts: 11
Posted 04:07 Feb 09, 2016 |

Some of them you can use regex to grab a number from the string: http://chrisalbon.com/python/pandas_regex_to_create_columns.html

Last edited by ringworld at 04:11 Feb 09, 2016.