1 Upvote

Create Dummy Variables with Pandas

Python
Data Preparation for Models

import pandas as pd
X = pd.get_dummies(X, columns=['neighbourhood_group','room_type'], drop_first=True)

By analyseup - Last Updated Jan. 12, 2022, 12:35 a.m.

Did you find this snippet useful?

Sign up to bookmark this in your snippet library

COMMENTS
RELATED SNIPPETS
Scale Data Using Standard Scaler in Sklearn
Python
Data Preparation for Models

Sklearn

3
Top Contributors
103
100