1
votes

I got a csv file with two headers, and I don't know how to express it either, I pasted it and this is what it looks like, I need to reorder it to be a normal csv file,No information in "age" key,I just want to retrieve "name" and "age",I need to output "first_name","last_name","age". And use "first_name","last_name","age" as the title,

"ID","meta_key","meta_data"
1,"nickname","dale ganger"
2,"first_name","ganger"
3,"last_name","dale"
4,"age",
5,"sex","F"

the way i need

"first_name","last_name","age"
"ganger","dale",null
so you want to check if each key has a value? - Ohad Sharet
I just want to retrieve "name" and "age" - lex9527
can you add your code to the post (the code you used to print this output) - Ohad Sharet
Definitely question is not clear, being said that; you can read your csv using pandas. import pandas as pd and df = pd.read_csv('data.csv'). It will handle headers for you, then you can do your manipulations. Because what you have pasted seems a transposed version of column names: meta_key, nickname, first_name, last_name, age, sex - mmustafaicer
What you have is a normal CSV file. Did you want to transpose your csv file so that the rows are columns? Please show your expected output. - Pranav Hosangadi