Lesson 1 ❮ Lesson List ❮ Top Page
❯ 1.2 Data Types Conversion
⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
EXPECTED COMPLETION TIME
❲▹❳ Video 5m 37s
☷ Interactive readings 5m
pandas does not broadly classify data as either continuous or categorical.
The following table contains all pandas data types, with their string equivalents, and some notes on each type:
To convert numerical to categorical, the astype method can be used. This method can cast a pandas object to a specified dtype.
To convert categorical to numerical, the get_dummies method can be used. It will convert the categorical column into a 0-1 columns called dummy variables.