Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to change entry in a row based on another columns entry python

import pandas
df = pandas.read_csv("test.csv")
df.loc[df.ID == 103, 'FirstName'] = "Matt"
df.loc[df.ID == 103, 'LastName'] = "Jones"
Comment

PREVIOUS NEXT
Code Example
Python :: python machine learning 
Python :: i have two versions of python installed mac 
Python :: create empty numpy array 
Python :: link shortener 
Python :: django on delete set default 
Python :: how to convert string to float in python 
Python :: how does works lamda in pyton 
Python :: csv in python 
Python :: multiple channel deleteing command in discord.py 
Python :: tuple in python 3 
Python :: merge two lists python 
Python :: python string to list of chars 
Python :: walrus operator python 3.8 
Python :: yaml validator python 
Python :: django jsonresponse 
Python :: pandas difference between two dataframes 
Python :: convert df.isnull().sum() to dataframe 
Python :: df set index 
Python :: rename rows pandas based on condiions 
Python :: how to append substring to string in specific position in python 
Python :: django test imagefield 
Python :: load specific columns dataframe 
Python :: regular expression syntax python 
Python :: numpy 
Python :: how stract avery .jpg string in a website python 
Python :: random playing card generator python 
Python :: does tuple allow duplicate values in python 
Python :: index in the pool python 
Python :: Changing the data type to category 
Python :: enumerate() 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =