简体   繁体   中英

Manipulating row data in CSV file and appending it in a new column using Python

I have an csv file consisting of a list of company names. The goal is to write a code to generate the direct indeed job listing link for each of these companies using the name alone. The indeed link for the company- " Company XYZ " will be - https://www.indeed.com/q- company - XYZ -jobs.html

The indeed link should be appended to the existing file under the column name indeed job link .

How do I go about this?

Assuming you have read the list of company names into a Pandas DataFrame, then you can simple do:

df["indeed_job_link"] = "https://www.indeed.com/q-" + df["company_name"] + "-jobs.html"
df.to_csv("result.csv", index=False)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM