<jupyter_start><jupyter_text>Tumor Response to Treatment<jupyter_code># Store the Mean Tumor Volume Data Grouped by Drug and Timepoint 
 
merged_df = combined.groupby(["Drug", "Timepoint"])
MeanTumorVolume = merged_df["Tumor Volume (mm3)"].mean()

# Convert to DataFrame
merged_df = pd.DataFrame(MeanTumorVolume)
MeanTumorVolume_df = pd.DataFrame(MeanTumorVolume)

# Preview DataFrame
MeanTumorVolume_df = MeanTumorVolume_df.reset_index()
MeanTumorVolume_df.head()

# # Store the Standard Error of Tumor Volumes Grouped by Drug and Timepoint
# standard_error = merged_df["Tumor Volume (mm3)"].sem()

# # # Convert to DataFrame
# standard_error_df = pd.DataFrame(standard_error)

# # Preview DataFrame
# # standard_error_df.reset_index(inplace=True)
# # standard_error_df.head()

StdError = grouped_df["Tumor Volume (mm3)"].sem()

# Convert to DataFrame
StdError_df = pd.DataFrame(StdError)

# Preview DataFrame
StdError_df.reset_index(inplace=True)
StdError_df.head()
# Minor Data Munging to Re-Format the Data Frames

# Preview that Reformatting worked

# Generate the Plot (with Error Bars)

#plot options
fig, ax = plt.subplots()
fig,ax.figure(figsize = (15,10))
ax.set_title('Tumor Volume Over Time', fontdict = {'fontsize': 18, 'fontweight': 'bold'})
ax.set_xlabel('Days', fontdict = {'fontsize': 15})
ax.set_ylabel('Tumor Volume (mm3)', fontdict = {'fontsize': 15})
ax.set_xticks(np.arange(0, avg_volume.index.max()+3 , 5)) # location of separators for timepoint
ax.set_xlim(0, avg_volume.index.max() + 1) 

#markers used throughout 
markers = ['o', 's', '^', 'd']

# independent variable
xvals = avg_volume.index #timepoints

#count for markers in plot loop
count = 0

#plot each tumor volume column with standard error
for c in avg_volume.columns:
    plt.errorbar(xvals, 
                 avg_volume[c], 
                 volume_sem[c], #std error
                 linestyle = '--', 
                 marker =  markers[count], 
                 capthick = 1, #for caps on error bars 
                 capsize = 3)  # for caps on error bars
    count += 1

#legend options
lg = plt.legend(numpoints = 2, # gives two symbols in legend
                frameon = True, 
                markerscale = 1.5, 
                edgecolor = 'black', 
                fontsize = '17', 
                framealpha = 1)
plt.show()

# Save the Figure


# Show the Figure
plt.show()<jupyter_output><empty_output><jupyter_text>![Tumor Response to Treatment](../Images/treatment.png)  Metastatic Response to Treatment<jupyter_code># Store the Mean Met. Site Data Grouped by Drug and Timepoint 

# Convert to DataFrame

# Preview DataFrame

# Store the Standard Error associated with Met. Sites Grouped by Drug and Timepoint 

# Convert to DataFrame

# Preview DataFrame

# Minor Data Munging to Re-Format the Data Frames

# Preview that Reformatting worked

# Generate the Plot (with Error Bars)

# Save the Figure

# Show the Figure<jupyter_output><empty_output><jupyter_text>![Metastatic Spread During Treatment](../Images/spread.png)  Survival Rates<jupyter_code># Store the Count of Mice Grouped by Drug and Timepoint (W can pass any metric)

# Convert to DataFrame

# Preview DataFrame

# Minor Data Munging to Re-Format the Data Frames

# Preview the Data Frame

# Generate the Plot (Accounting for percentages)

# Save the Figure

# Show the Figure
plt.show()<jupyter_output><empty_output><jupyter_text>![Metastatic Spread During Treatment](../Images/survival.png)  Summary Bar Graph<jupyter_code># Calculate the percent changes for each drug

# Display the data to confirm

# Store all Relevant Percent Changes into a Tuple


# Splice the data between passing and failing drugs


# Orient widths. Add labels, tick marks, etc. 


# Use functions to label the percentages of changes


# Call functions to implement the function calls


# Save the Figure


# Show the Figure
fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09665047302480184, 'fraction_numerical': 0.007414983380209665, 'mean_word_length': 3.9269521410579347, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '184857', 'license': 'ADSL', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1216, 'n_words': 389, 'path': 'pymaceuticals.ipynb', 'repo_name': 'mdimas2015/matplotlib-challenge', 'size': '3911'}