Horje
split column and rename them Code Example
split column and rename them
# importing pandas module 
import pandas as pd
   
# reading csv file from url 
data = pd.read_csv("https://media.geeksforgeeks.org/wp-content/uploads/nba.csv")
  
# dropping null value columns to avoid errors
data.dropna(inplace = True)
  
# new data frame with split value columns
new = data["Name"].str.split(" ", n = 1, expand = True)
  
# making separate first name column from new data frame
data["First Name"]= new[0]
  
# making separate last name column from new data frame
data["Last Name"]= new[1]
  
# Dropping old Name columns
data.drop(columns =["Name"], inplace = True)
  
# df display
data




Python

Related
python tf.maximum Code Example python tf.maximum Code Example
compressed list Code Example compressed list Code Example
np array specified lengte same value Code Example np array specified lengte same value Code Example
# check if file exists Code Example # check if file exists Code Example
create new python environment check Code Example create new python environment check Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7