"convert a column into binary" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "convert a column into binary" answered properly. Developers are finding an appropriate answer about convert a column into binary related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like convert a column into binary. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on convert a column into binary.
convert a column into binary
data.Gender[data.Gender == 'male'] = 1
data.Gender[data.Gender == 'female'] = 0
print(data)
Source: stackoverflow.com
convert a column into binary
import pandas as pd
file = open("your.csv", "r")
data = pd.read_csv(file, sep = ",")
gender = {'male': 1,'female': 0}
data.Gender = [gender[item] for item in data.Gender]
print(data)
Source: stackoverflow.com
All those coders who are working on the Whatever based application and are stuck on convert a column into binary can get a collection of related answers to their query. Programmers need to enter their query on convert a column into binary related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about convert a column into binary for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of convert a column into binary while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "convert a column into binary". Visit this developer's friendly online web community, CodeProZone, and get your queries like convert a column into binary resolved professionally and stay updated to the latest Whatever updates.