Finalized SKUID script! Attempts at json to csv script.
This commit is contained in:
@ -35,9 +35,9 @@ def lpLevels(basecsv, lpcsv):
|
||||
index_col=1,
|
||||
)
|
||||
newDf = levels.groupby("Learning Path")
|
||||
learningpaths = newDf.apply(lambda x: x["Course Name"].unique())
|
||||
# learningpaths = newDf2.apply(pd.Series)
|
||||
# learningpaths.rename_axis(index=0)
|
||||
newDf2 = newDf.apply(lambda x: x["Course Name"].unique())
|
||||
learningpaths = newDf2.apply(pd.Series)
|
||||
learningpaths.rename_axis(index=0)
|
||||
mainFunc(basecsv, learningpaths)
|
||||
# print(levels.Level.unique()) # Print only unique values from the Level column
|
||||
|
||||
@ -54,42 +54,22 @@ def mainFunc(basecsv, learningpaths):
|
||||
# This prints a dataframe with the learner's name as the index column and the courses as adjacent columns
|
||||
|
||||
# Part 2
|
||||
# learningpaths.set_index(0)
|
||||
courses = learningpaths.set_index(0)
|
||||
# print(courses)
|
||||
lp_dict = learningpaths.to_dict()
|
||||
courses = lp_dict.values()
|
||||
print(courses)
|
||||
# crs = courses
|
||||
# print(crs)
|
||||
|
||||
# lp_dict = learningpaths.to_dict("index")
|
||||
# courses = lp_dict.values()
|
||||
# Part 3
|
||||
# for course in courses:
|
||||
# print(df2.isin(course))
|
||||
print(df2.isin(df2))
|
||||
# This produces a bunch of T/F in the dataframe. Is the solution to do:
|
||||
# for courses in lp_dict, for row(person) in readData
|
||||
# if number of True == length/# of values in courses
|
||||
# Add to "Finished List"
|
||||
|
||||
# df3 = df2.columns
|
||||
# print(df3)
|
||||
# for name in df3.items():
|
||||
# print(f"name: {name}")
|
||||
|
||||
# emailGroups = readData.groupby(["Email", "Learner Full Name"])["Course Name"].nunique()
|
||||
# print(emailGroups)
|
||||
# emailGroups = people.to_csv(
|
||||
# "/Users/normrasmussen/Documents/Northpass/Scripts/Skuid_LPs/outtest2.csv"
|
||||
# )
|
||||
# if readData.loc[readData['Course Name'].isin([
|
||||
# 'Get Started with Models - Level 1',
|
||||
# 'Configure Model Fields - Level 1',
|
||||
# 'Configure Model Conditions - Level 1',
|
||||
# 'Configure Model Actions - Level 1',
|
||||
# 'Manage Models - Level 1',
|
||||
# 'Intro to UI Only Fields - Level 1'])]:
|
||||
# extractedList = readData.loc[readData['Email'].tolist()]
|
||||
# fourOccs = Counter(extractedList)
|
||||
# finalNames = []
|
||||
# for name, occurrences in fourOccs.items():
|
||||
# if occurrences == 6:
|
||||
# finalNames.append(name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# mainFunc(basecsv)
|
||||
|
||||
Reference in New Issue
Block a user