filmov
tv
Data analysis with python and Pandas - Convert String Category to Numeric Values Tutorial 6

Показать описание
Hi Guys checkout my udemy course at just 9.99$
Visit complete course on Data Science with Python :
For All other visit my udemy profile at :
This video will explain how to convert String categorical values to numerical values with apply function in pandas.
import pandas as pd
data = {'Id_Student' : [1,2,3,4,5,6,7,8,9,10],'Mathscore' :['Strong','Weak','Weak','Strong','Strong','Weak','Strong','Strong','Weak','Strong']}
df = pd.DataFrame(data)
df
# # Strong = 1 and Weak =0
def tran_mathscore(x):
if x == 'Strong':
return 1
if x == 'Weak':
return 0
df['Trans_MathScore'] = df['Mathscore'].apply(tran_mathscore)
df
Visit complete course on Data Science with Python :
For All other visit my udemy profile at :
This video will explain how to convert String categorical values to numerical values with apply function in pandas.
import pandas as pd
data = {'Id_Student' : [1,2,3,4,5,6,7,8,9,10],'Mathscore' :['Strong','Weak','Weak','Strong','Strong','Weak','Strong','Strong','Weak','Strong']}
df = pd.DataFrame(data)
df
# # Strong = 1 and Weak =0
def tran_mathscore(x):
if x == 'Strong':
return 1
if x == 'Weak':
return 0
df['Trans_MathScore'] = df['Mathscore'].apply(tran_mathscore)
df
Data Analysis with Python - Full Course for Beginners (Numpy, Pandas, Matplotlib, Seaborn)
How I use Python as a Data Analyst
Data Analysis with Python Course - Numpy, Pandas, Data Visualization
Data Analysis with Python for Excel Users - Full Course
Exploratory Data Analysis with Pandas Python
Data Analysis with Python: Part 1 of 6 (Live Course)
Intro to Data Analysis / Visualization with Python, Matplotlib and Pandas | Matplotlib Tutorial
Exploratory Data Analysis (EDA) Using Python | Python Data Analysis | Python Training | Edureka
Supply Chain Analysis with Python 43 Inventory Aging Report Automation
Data Analytics With Python | Data Analysis With Python | Data Analytics For Beginners | Simplilearn
Python 🐍 Vs. R 🏴☠️
Is Python Really Needed For a Data Analyst Job?
Economic Data Analysis Project with Python Pandas - Data scraping, cleaning and exploration!
Python For Data Analysis | Data Analysis Using Python | Python Data Analysis Tutorial | Edureka
Data Analysis | Capstone Project | Power BI + SQL + Python + Excel | End to End | Edition 2025
Learn how to use PANDAS in Python in 15 minutes - with 10 real examples
Python for Beginners | Google Advanced Data Analytics Certificate
Do FASTER Python Exploratory Data Analysis with this!
I started my data analyst career taking these beginner courses
How to Automate Data Analysis In 1 LINE Of Python Code With Pandas Profiling #shorts
Will Polars replace Pandas for Data Science?
Pandas & Python for Data Analysis by Example – Full Course for Beginners
Learning Machine Learning has never been easier #shorts #machinelearning #statistics #datascience
Python Project for Data Analysis- Exploratory Data Analysis | Data Analyst Project
Комментарии