On Sun, Feb 17, 2013 at 1:37 PM, Thomas Haslwanter
<
thomas.h...@gmail.com> wrote:
> Hi,
> I am trying to work through the examples in "Will it Python", and have
> difficulty with the statsmodel formula version of the logit command.
>
> with
>
>> from pandas import *
>> from statsmodels.formula.api import logit
>>
>>
>>
>> heights_weights = read_table('data/01_heights_weights_genders.csv',
>>
>> sep = ',', header = 0)
>>
>> heights_weights['Male'] = heights_weights['Gender'].map({'Male': 1,
>> 'Female': 0})
>> male_logit = logit(formula = 'Male ~ Height + Weight', df =
>> heights_weights).fit()
>
>
> I get the error message
>
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call last)
> <ipython-input-4-e6e05e292e29> in <module>()
> 1 heights_weights['Male'] = heights_weights['Gender'].map({'Male': 1,
> 'Female': 0})
> ----> 2 male_logit = logit(formula = 'Male ~ Height + Weight', df =