This commit is contained in:
2019-05-07 12:11:38 +02:00
parent b7fe23abe3
commit 3ebd14c84e
23 changed files with 334 additions and 0 deletions

27
project/readData.py Normal file
View File

@@ -0,0 +1,27 @@
import pandas as pd
with open("DataScienceData01.txt","r") as infile:
lines = infile.readlines()
def dataParse(l):
objs = l.split("& ")
dic = {}
for obj in objs:
items = obj.split("=")
title = items[0]
data = items[1].split(",")
if len(data) == 1:
data = data[0]
dic[title] = data
return dic
data = []
for l in lines:
data.append(dataParse(l))
df = pd.DataFrame(data)
print(df)