How to encode a df?

Viewed 15

I have the following df called x

buying  maint   safety
0   vhigh   vhigh   med
1   vhigh   vhigh   high
2   vhigh   vhigh   low
3   vhigh   vhigh   med
4   vhigh   vhigh   high
... ... ... ...
1722    low low med
1723    low low high
1724    low low low
1725    low low med
1726    low low high

It has the following values - vhigh, high, med, low

How do I encode this since one hot encoding, ordinal encoding, Label encoding & map encoding only seem to encode pd.series & not pd.df?

0 Answers
Related