I have this working function that takes 2 inputs as .csv files and shows chart of the data. What I would like to do is to turn function input into list instead of 2 files.
This is the function:
def Graph(first_file,second_file):
fig = make_subplots(rows=1, cols=3)
list_of_atributes = ["Total", "Clean", "Dirty"]
data = pd.read_csv(first_file)
data2= pd.read_csv(second_file)
df = pandas.DataFrame(data)
df2 = pandas.DataFrame(data2)
data_list = []
data_list2 = []
show_bar = df[df.Name == "SUM"]
show_bar2 = df2[df2.Name == "SUM"]
for n in list_of_atributes:
data_list.append(int(show_bar[n]))
data_list2.append(int(show_bar2[n]))
fig.add_trace(go.Bar(name='File 1', x=list_of_atributes, y=data_list, marker=dict(color='red')), row=1, col=2)
fig.add_trace(go.Bar(name='File 2', x=list_of_atributes, y=data_list2 ,marker=dict(color='blue')), row=1, col=1)
fig.show()
Grapfh("file1.csv", "file2.csv")