Загрузка страницы

Dummy Variables | Get Dummies to transform Categorical Variables into Boolean using python pandas

Dummy Variables | Get Dummies to transform Categorical Variables into Boolean using python pandas

pandas.get_dummies() is used for data manipulation. It is used to convert categorical variable into dummy/indicator variables.

Code Starts Here
===============
import pandas as pd

data = {'firstname': ['Arun', 'Jebu', 'Venkat', 'Rekha', 'Majid','Mohsin'],
'lastname': ['Kumar', 'Jacob', 'Raghavan', 'Singh', 'Khan','Khan'],
'employmenttype': ['Service', 'Business', 'Student', 'Service', 'Business','Business'],
'country' :['India','USA','USA','Sweden','Australia','Germany']}
df = pd.DataFrame(data, columns = ['firstname','lastname','employmenttype','country'])

df1 = pd.get_dummies(df['employmenttype'])

df2 = pd.get_dummies(df['country'])

frames = [df,df1,df2]

result = pd.concat(frames,axis=1)

dataset = pd.read_csv('Datapreprocessing.csv')

dataset1 = pd.get_dummies(dataset['Country'])

frames1 = [dataset,dataset1]

result1 = pd.concat(frames1,axis=1)
All Playlist of this youtube channel
====================================

1. Data Preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuOjFcbnXLFvSQaHFK3ymUW

2. Confusion Matrix in Machine Learning, ML, AI
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvXzvsEcgb0IZtNsw_0vUzr

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsBCsWwz_BvbZZHIVQ6wSZK

4. Cross Validation, Sampling, train test split in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsHtol5WXHhq_B3kQPggHH2

5. Drop and Delete Operations in Python Pandas
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtvqVVK7QVFsMvDvp2YgCnR

6. Matrices and Vectors with python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsndwnZnL7nXW5mIrdRmgdg

7. Detect Outliers in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvyCX35yES5D9W7vThiUzwk

8. TimeSeries preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPv10bru3719xzDNIgbO6hXA

9. Handling Missing Values in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvOec0LZ40Bt8OQcbLFa236

10. Dummy Encoding Encoding in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvu7YriqMZsL9UDbqUUk90x

11. Data Visualisation with Python, Seaborn, Matplotlib
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuYBYsmbfMjROOCzKjCwyMH

12. Feature Scaling in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtwpVV3FwzwYZYR5hT3i52G

13. Python 3 basics for Beginner
https://www.youtube.com/playlist?list=PLE-8p-CwnFPu-jseUMtc4i47jQZN4PNbf

14. Statistics with Python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPta0COlxS6E5u14m5ouzbRU

15. Sklearn Scikit Learn Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtAGb29r8F7up9ilZUXt3l1

16. Python Pandas Dataframe Operations
https://www.youtube.com/playlist?list=PLE-8p-CwnFPv_63lkT_Tztiwknv_zGTNy

17. Linear Regression, Supervised Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPslDi6sfFbFK4KXcVlLwaOM

18 Interiew Questions
https://www.youtube.com/playlist?list=PLE-8p-CwnFPt7VBhcnh82y0autSzuOrZp

19. Jupyter Notebook Operations
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtqkFd67OZcoSv4BAI7ez5_

Видео Dummy Variables | Get Dummies to transform Categorical Variables into Boolean using python pandas канала technologyCult
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
22 января 2018 г. 1:23:20
00:04:37
Другие видео канала
Data Visualisation with Matplotlib | xlim | ylim| legend | axis | axes - P2Data Visualisation with Matplotlib | xlim | ylim| legend | axis | axes - P2How to create Python Emojis using Emojis Package | Python Emojis Package | Python EmojisHow to create Python Emojis using Emojis Package | Python Emojis Package | Python EmojisOrthogonal and Singular Matrix with Python | Orthogonal Matrix | Singular Matrix - P11Orthogonal and Singular Matrix with Python | Orthogonal Matrix | Singular Matrix - P11Python 3 Basics # 17 | Python Sets | Sets in Python | Python for BeginnersPython 3 Basics # 17 | Python Sets | Sets in Python | Python for BeginnersLogistic Regression | Machine Learning | Why Log Transformation in Logistic RegressionLogistic Regression | Machine Learning | Why Log Transformation in Logistic RegressionMatrices and Vectors with Python | How to flatten a matrix using Python? - P5Matrices and Vectors with Python | How to flatten a matrix using Python? - P5Read Tables from HTML page using Python Pandas - P1.5Read Tables from HTML page using Python Pandas - P1.5Python Pandas Map Function | What if key is missing from the dictionary that we are trying to map?Python Pandas Map Function | What if key is missing from the dictionary that we are trying to map?Determinant Of N X N Matrix | How to find the determinant of a MatrixDeterminant Of N X N Matrix | How to find the determinant of a MatrixConfusion Matrix Interview Question | Precision | Recall | AccuracyConfusion Matrix Interview Question | Precision | Recall | AccuracyPython 3 Basics # 17.3 | Python Sets |  Python Set Method | Add | Remove | Copy | DiscardPython 3 Basics # 17.3 | Python Sets | Python Set Method | Add | Remove | Copy | DiscardPython 3 Basics # 6.1 | Numpy Array | Storage | Speed | Iterate with numpy | Python for BeginnersPython 3 Basics # 6.1 | Numpy Array | Storage | Speed | Iterate with numpy | Python for BeginnersConfusion Matrix | ML | AI | Heat Map | Visualisation | Make_Classification | Sklearn - P2Confusion Matrix | ML | AI | Heat Map | Visualisation | Make_Classification | Sklearn - P2Python 3 Basics # 4.3 | How to reverse Python Lists?Python 3 Basics # 4.3 | How to reverse Python Lists?Python 3 Basics # 3 | Python Strings Manipulation  | Step Function |  Python for BeginnersPython 3 Basics # 3 | Python Strings Manipulation | Step Function | Python for BeginnersPython Basics # 4 | List Operations | append | extend | sort | remove | delete | slicing in pythonPython Basics # 4 | List Operations | append | extend | sort | remove | delete | slicing in pythonPython 3 Basics # 4.1 | How to multiply all the elements of a Python List?Python 3 Basics # 4.1 | How to multiply all the elements of a Python List?Logistic Regression with no Predictor variable | Machine Learning - P6ALogistic Regression with no Predictor variable | Machine Learning - P6AHow to Concatenate tuples in python? | sum | join | zip | Python BasicsHow to Concatenate tuples in python? | sum | join | zip | Python BasicsSolutions for Machine Learning - Data Science Interview Question | September 14th to 20th, 2020 - P2Solutions for Machine Learning - Data Science Interview Question | September 14th to 20th, 2020 - P2Python 3 Basics # 11.3 | Python List ComprehensionsPython 3 Basics # 11.3 | Python List Comprehensions
Яндекс.Метрика