Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tree using CSV
#4
May his name is a hint pandeyrishabh Wink
Quote:visualise it in Tree format
This is as mention unclear.
import pandas as pd
from io import StringIO
 
data = StringIO('''\
id,Name,ParentId
ACAD0100,Academics,
ACAD0101,Science,ACAD0100
ACAD0201,Maths,ACAD0100
ACAD0301,Social Science,ACAD0100
ACAD0102,Biology ,ACAD0101
ACAD0103,Biotechnology,ACAD0101
ACAD0105,Health & Wellness,ACAD0101
ACAD0202, Algebra,ACAD0201
ACAD0203,Calculus,ACAD0201
ACAD0204,Geometry,ACAD0201
ACAD0302, Anthropology,ACAD0301
ACAD0303, Psychology,ACAD0301''')
 
df = pd.read_csv(data, sep=",")
df
[Image: VvVMTt.png]
Reply


Messages In This Thread
Tree using CSV - by pandeyrishabh - Jul-31-2018, 05:31 AM
RE: Tree using CSV - by Gribouillis - Jul-31-2018, 07:01 AM
RE: Tree using CSV - by Axel_Erfurt - Jul-31-2018, 10:41 AM
RE: Tree using CSV - by snippsat - Jul-31-2018, 12:29 PM
RE: Tree using CSV - by pandeyrishabh - Aug-03-2018, 11:51 AM
RE: Tree using CSV - by Gribouillis - Aug-03-2018, 12:08 PM
RE: Tree using CSV - by pandeyrishabh - Aug-03-2018, 12:14 PM
RE: Tree using CSV - by Gribouillis - Aug-03-2018, 02:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020