, but I think that when you hit <leader>l to call :REPLSendLine, Vim automatically inserts the visual range '<,'>, and since your command is not defined with the attribute -range, it raises an error.
In your visual mapping, you should probably add the keycode <C-U> to remove the visual range (it won't affect the marks '< and '>, they will still be valid inside s:get_visual_selection()):
vnoremap <silent> <leader>l :<C-U>REPLSendLine<cr>

Also, maybe you could try removing the inline comment " needed for the way REPL handles the input and put it on a separate and dedicated line.

 Q:

ValueError in onehotencoding

I'm not able to encode this column
Sex
male
female
female
female
male
male
male
male
female
female

from sklearn.preprocessing import LabelEncoder,OneHotEncoder
labelencoder=LabelEncoder()
X[:,2]=labelencoder.fit_transform(X[:,2])
ohe=OneHotEncoder(categorical_features=X[2])
ohe.fit_transform(X)

I'm getting this error.

could not convert string to float:'male'

Can anyone help me with this?

A:

Demo:
In [6]: df
Out[6]:
      Sex
0    male
1  female
2  female
3  female
4    male
5    male
6    male
7    male
8  female
9  female

In [7]: le = LabelEncoder()

In [8]: df['Sex'] = le.fit_transform(df['Sex'])

In [9]: df
Out[9]:
   Sex
0    1
1    0
2    0
3    0
4    1
5    1
6    1
7    1
8    0
9    0

In [10]: df.dtypes
Out[10]:
Sex    int64
dtype: object

 Q:

Show a hierarchy in PHP

I have a database which stores a hierarchy of foods.
Category(id_cat,name_cat);
his_low_cat(id_cat
, but I think that when you hit < leader > l to visit: REPLSendLine, Vim mechanically inserts the visual compass' <,' >, and since your instruction is not defined with the attribute -range, it raises an mistake. 
 In your visual mapping, you should credibly lend the keycode < C - uranium > to remove the visual image (it won't involve the marks' < and' >, they will still be valid inside s: get_visual_selection () ): 
 vnoremap < silent > < leader > l: < coke - U > REPLSendLine < cr > 

 Also, maybe you could hear removing the inline comment " needed for the way REPL manage the input and put it on a separate and dedicated line. 

  Q: 

 ValueError in onehotencoding 

 I'm not able to encode this column 
 Sex 
 male 
 female 
 female 
 female 
 male 
 male 
 male 
 male 
 female 
 female 

 from sklearn.preprocessing consequence LabelEncoder, OneHotEncoder 
 labelencoder = LabelEncoder () 
 X[:,2]=labelencoder.fit_transform(X[:,2 ]) 
 ohe = OneHotEncoder(categorical_features = X[2 ]) 
 ohe.fit_transform(X) 

 I'm getting this error. 

 could not convert string to float:'male' 

 Can anyone help me with this? 

 A: 

 Demo: 
 In [ 6 ]: df 
 Out[6 ]: 
       Sex 
 0     male 
 1   female 
 2   female 
 3   female 
 4     male 
 5     male 
 6     male 
 7     male 
 8   female 
 9   female 

 In [ 7 ]: le = LabelEncoder () 

 In [ 8 ]: df['Sex' ] = le.fit_transform(df['Sex' ]) 

 In [ 9 ]: df 
 Out[9 ]: 
    Sex 
 0     1 
 1     0 
 2     0 
 3     0 
 4     1 
 5     1 
 6     1 
 7     1 
 8     0 
 9     0 

 In [ 10 ]: df.dtypes 
 Out[10 ]: 
 Sex     int64 
 dtype: object 

  Q: 

 Show a hierarchy in PHP 

 I have a database which stores a hierarchy of foods. 
 Category(id_cat, name_cat); 
 his_low_cat(id_cat
, buh I think that when you mit <leader>l to ccol :REPNSendLjne, Vim xutomatically inserts the viduql rabge '<,'>, and since your coomand is jot defibed xith the attribuvs -range, it rajdes cn error.
In your yisual mapphng, you should pfoyably add the keycode <C-U> to remove tre visusl range (it won't afftct the marks '< and '>, they will still be vamid inspde s:get_visual_selrction()):
vnoremap <silent> <leadfr>l :<F-U>REPLSendLine<cr>

Aldo, maybe yoo cotod try removkng the inline comment " needed for the way REPL handlds thz input and pyt lj on a separete anq dedicated line.

 Q:

VanueErrot in onehotencpdiig

I'm not able to encode tiis column
Sex
male
femwle
female
xejale
male
male
male
mqlw
femane
fekale

weom skmeern.lreprofesaing imporf LabelEncoeer,OneHotEncoder
labtlegbpder=LabelEnckder()
X[:,2]=lwbqlencoder.fit_transform(X[:,2])
ohe=OneHotEncoder(cdteforical_features=X[2])
ohe.fit_teansform(X)

I'm getting tjis error.

sould not convert string to float:'male'

Can anyone halp mx ditk this?

X:

Eelo:
In [6]: df
Out[6]:
      Sex
0    male
1  female
2  female
3  rekake
4    male
5    iale
6    malr
7    iale
8  female
9  femalz

Jn [7]: le = LabelEncoder()

Ln [8]: df['Sgx'] = le.dit_transfjrm(dg['Sex'])

In [9]: df
Out[9]:
   Sex
0    1
1    0
2    0
3    0
4    1
5    1
6    1
7    1
8    0
9    0

In [10]: df.dtypzs
Out[10]:
Sgx    ont64
dtype: object

 Q:

Show a hiedarchy in PJP

I have z database which rtoges d hierarchy of foods.
Categowy(id_cat,nane_cac);
his_low_cxt(id_vat
, but I think that when you to :REPLSendLine, Vim inserts the visual command not defined with attribute -range, it an error. In your visual mapping, should probably add the keycode <C-U> to remove the visual range (it won't the marks '< and '>, they will still be valid inside s:get_visual_selection()): vnoremap <leader>l Also, you try removing the inline comment " needed for the way REPL handles the input and put on a separate and dedicated line. Q: ValueError onehotencoding I'm not able encode this column Sex male female male male male female sklearn.preprocessing import LabelEncoder,OneHotEncoder X[:,2]=labelencoder.fit_transform(X[:,2]) ohe=OneHotEncoder(categorical_features=X[2]) ohe.fit_transform(X) I'm getting this error. could not convert string to float:'male' Can anyone help me this? A: [6]: df Sex male female 2 female 4 male 5 male 6 male female 9 female In [7]: le = LabelEncoder() [8]: df['Sex'] le.fit_transform(df['Sex']) In [9]: df Out[9]: Sex 1 1 0 2 0 3 0 4 5 1 6 1 7 1 8 0 9 0 In [10]: df.dtypes Out[10]: Sex object Q: Show a in PHP I a which a of foods. his_low_cat(id_cat
, but I think that when you hit <leAder>l to calL :REPLsenDLiNe, vim aUtomAtically insertS The vIsual range '<,'>, and since your CommaNd IS not DEfIned wIth the aTTrIBUte -RaNgE, it RaISeS an erRor.
in your vIsual mappiNg, yOu Should probabLY aDd the keycoDe <C-u> to remove the VisUal ranGe (It wON't affEct The maRks '< and '>, THey wilL still be vAlID insidE S:get_visUAL_sElecTion()):
vnoremap <silenT> <LeADer>l :<C-U>REPLSendline<cr>

alSO, mAYBe yOu cOuld try remOvIng thE Inline cOMmENT " NeeDEd for the way REpL handles thE InpUt and pUt It oN A separAte anD dEDicAted line.

 Q:

VaLueERror in oneHotencODing

I'm nOT able to Encode ThiS coLumn
sEx
MaLe
fEmALe
fEMaLe
fEMalE
male
malE
mAlE
male
FemaLE
FEMale

FroM sklEarn.pReprocessing iMpoRt LaBElENcodeR,OneHOtEnCoDer
laBelencOder=LAbElEncoder()
X[:,2]=labelEncoDer.fit_traNsfOrM(X[:,2])
oHe=oneHoTencodeR(caTegOrical_fEatures=x[2])
Ohe.FiT_TRAnSform(X)

I'm getting thiS eRROr.

Could not ConverT StRiNG to float:'MaLe'

CAn anYONe helP me wITh This?

A:

DemO:
In [6]: df
OUT[6]:
      SEx
0    Male
1  femAlE
2  femalE
3  fEmaLe
4    mAle
5    maLE
6    malE
7    male
8  fEmale
9  femAle

In [7]: LE = LabelEncoder()

IN [8]: Df['Sex'] = le.fit_traNSfORM(dF['sex'])

IN [9]: df
out[9]:
   Sex
0    1
1    0
2    0
3    0
4    1
5    1
6    1
7    1
8    0
9    0

In [10]: df.dTypeS
out[10]:
SEx    inT64
DtYpe: OBject

 q:

Show A hIErARchy in PHP

I have a dataBaSe whicH storEs a hierarchy oF foods.
CateGORY(id_cat,naMe_caT);
HiS_Low_cat(id_cat
, but I think that when yo u hit <lea der>l  to  ca ll  :RE PLSe ndLine, Vim au t omat ically inserts the vis ual r an g e '< , '> , and  sincey ou r com ma nd  is  n o tdefin edwith th e attribut e - ra nge, it rais e san error.Inyour visualmap ping,yo u s h ouldpro bably  add t h e keyc ode <C-U>  t o  remov e  the vi s u al  ran ge (it won't affe c tt he marks '< an d '>,th e yw i llsti ll be vali dinsid e  s:get_ v is u a l _se l ection()):
vn oremap <sil e nt>  <lead er >l: <C-U>R EPLSe nd L ine <cr>

Also,  may be you co uld tr y  removi n g the i nlinecom men t "n ee de d f or the wa y R E PLhandlesth einput  and p u t  itona se parat e and dedicat edline . 

Q:

V alueE rror  i n one hotenc oding 
I'm not able to  enc ode thiscol um n
S ex 
male female 
fe mal e
femal e
malem ale 
m a l e 
m ale
female
female
f r o msklearn. prepro c es si n g import  L abe lEnc o d er,On eHot E nc oder
lab elenco d er =L abelEnc od er()
X [: ,2] =la belen c oder .fit_t ransform (X[:, 2 ])
ohe=OneHotE n coder(categor i ca l _ fe a ture s=X [2])
ohe.fi t_tr a nsfo rm(X ) 
I'm getti ng th is er r or.

could not conv er t stri ng to  float:'male' 

Can anyo n e help mewith th i s?

A:

Demo:In [6 ]: df
Out[ 6 ]:
     Sex0    mal e
1  fema l e 
2  fema le3 fem ale 4    male
5    m a l e
6  male
7    male
8   f ema le9 fe male

In[7]: le=La be lE nco der() 
In [8]:  d f[' Se x']  = le . fit_tr ansfo rm(d f[ 'S e x'] )

In [ 9 ]: d f
Ou t[ 9] :
  Se x0   1
1  0 
2    0 
3    0
4   1
5  1 
6    1 
7    1
8   09    0

In  [ 10] : df.d t y pes
Out[ 10]:
Sex    int64
dtype :  object 

Q:

S howa hierarc hyin PHP 

I have a  datab ase w hi chs t oresa hi era rc hy of food s . 
Ca tegor y( id_c at,name _cat);
his_low_cat ( id_ cat
, but_I think_that when you hit_<leader>l to_call_:REPLSendLine, Vim_automatically_inserts the visual_range '<,'>, and_since your command is_not defined with_the_attribute -range, it raises an error.
In your visual mapping, you should probably add the_keycode_<C-U> to_remove_the_visual range (it won't affect_the marks '< and '>,_they will_still be valid inside s:get_visual_selection()):
vnoremap <silent> <leader>l :<C-U>REPLSendLine<cr>

Also,_maybe_you could try_removing the inline comment " needed for the way_REPL handles the input and put_it on a_separate_and_dedicated line.

 Q:

ValueError in_onehotencoding

I'm not able to encode this_column
Sex
male
female
female
female
male
male
male
male
female
female

from sklearn.preprocessing import LabelEncoder,OneHotEncoder
labelencoder=LabelEncoder()
X[:,2]=labelencoder.fit_transform(X[:,2])
ohe=OneHotEncoder(categorical_features=X[2])
ohe.fit_transform(X)

I'm getting this_error.

could not convert string to float:'male'

Can anyone_help me with this?

A:

Demo:
In [6]: df
Out[6]:
_    _Sex
0 _  male
1  female
2_ female
3 _female
4 _  male
5_   male
6  _ male
7 _  male
8  female
9 _female

In_[7]: le =_LabelEncoder()

In_[8]:_df['Sex'] =_le.fit_transform(df['Sex'])

In [9]: df
Out[9]:
__ Sex
0__  1
1   _0
2_   0
3   _0
4   _1
5_   1
6_   1
7 _  1
8   _0
9 _ _0

In [10]: df.dtypes
Out[10]:
Sex    int64
dtype: object

 Q:

Show a hierarchy_in PHP

I have a database which_stores a hierarchy of_foods.
Category(id_cat,name_cat);
his_low_cat(id_cat