Plots the columns of a dataframe. Either all of the columns in the dataframne can be plotted at once, or specific columns can be plotted seperately. For the example we will look at a datafraame with four columns: mutated, submitted, started and completed.
Examples
--------
>>>plot_df(my_dataframe)
This will return a plot of all four columns.
>>>plot_df(my_dataframe['completed'])
This will return a plot of only the column 'completed'.
"""
ifset_minimum_time==True:
df=(df-df.min().min())/1e9
formy_columnindf.columns:
y=df[my_column]
plt.scatter(y)
plt.plotsize(100,30)
plt.title(f"{my_column}")
plt.xlabel("number of jobs")
plt.ylabel("time (s)")
plt.show()
defreturn_dataframe(node_list):
"""
Returns a formatted pandas dataframe.
"""
my_list=[]
formy_nodeinnode_list:
my_list.append(read_json(my_node.log_file))
returnpd.DataFrame(my_list)
defadd_duration(df):
"""
Adds a duration column to the dataframe, which is the time a job takes to be completed after it is started.
"""
df["duration"]=df["completed"]-df["started"]
defadd_pending(df):
"""
Adds a pending column to the dataframe, which is the time a job takes to start after it has been submitted.
"""
df["pending"]=df["started"]-df["submitted"]
defshow_progress(df):
"""
Shows the progress of the jobs which are running. It returns a set of progress bars corresponding to the status of the different jobs. So it would return progress bars for 'mutated', submitted' etc.
Plots the columns of a dataframe. Either all of the columns in the dataframne can be plotted at once, or specific columns can be plotted seperately. For the example we will look at a datafraame with four columns: mutated, submitted, started and completed.
Examples
--------
>>>plot_df(my_dataframe)
This will return a plot of all four columns.
>>>plot_df(my_dataframe['completed'])
This will return a plot of only the column 'completed'.
"""
ifset_minimum_time==True:
df=(df-df.min().min())/1e9
formy_columnindf.columns:
y=df[my_column]
plt.scatter(y)
plt.plotsize(100,30)
plt.title(f"{my_column}")
plt.xlabel("number of jobs")
plt.ylabel("time (s)")
plt.show()
defreturn_dataframe(node_list):
"""
Returns a formatted pandas dataframe.
"""
my_list=[]
formy_nodeinnode_list:
my_list.append(read_json(my_node.log_file))
returnpd.DataFrame(my_list)
defadd_duration(df):
"""
Adds a duration column to the dataframe, which is the time a job takes to be completed after it is started.
"""
df["duration"]=df["completed"]-df["started"]
defadd_pending(df):
"""
Adds a pending column to the dataframe, which is the time a job takes to start after it has been submitted.
"""
df["pending"]=df["started"]-df["submitted"]
defshow_progress(df):
"""
Shows the progress of the jobs which are running. It returns a set of progress bars corresponding to the status of the different jobs. So it would return progress bars for 'mutated', submitted' etc.