You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below provides a solution for a student plot. At the bottom it has this
### DO NOT REMOVE LINE BELOW ###
ax1 = nb.convert_axes(plt)
I believe that we need to grab the axis object and not call plt.show() but i'm not 100% sure. I am curious why that code disappeared for the first PLOT assignment cell of homework 5 but not for the second.
# For PLOT 1&2: use the data/colorado-flood/precipitation/805325-precip-dailysum-2003-2013.csv file
# PLOT 1: a plot of precipitation from 2003 to 2013
# DO NOT USE plt.show() anywhere in this cell
# BEGIN SOLUTION
f = "data/colorado-flood/discharge/06730200-discharge-daily-1986-2013.txt"
discharge = pd.read_csv(f,
skiprows=23,
header=[1, 2],
sep='\t',
parse_dates=[2])
discharge.columns = discharge.columns.droplevel(1)
discharge = discharge.set_index(["datetime"])
monthly_max_all = discharge.resample("M").max()
monthly_max = monthly_max_all['1990':'2014']
# Create scatter plot
fig, ax = plt.subplots(figsize=(10, 8))
ax.scatter(x=monthly_max.index,
y=monthly_max["17663_00060_00003"],
color="purple")
ax.set(xlabel='Date', ylabel='Daily Precipitation (inches)',
title='Homework plot 1: Precipitation-Boulder, CO\n 2013-2014')
# END SOLUTION
### DO NOT REMOVE LINE BELOW ###
ax1 = nb.convert_axes(plt)
Can you show me how to customize what a student sees? This cell is visually confusing to a student. i wasn't sure where to add my homework code. I am curious. is there a way to embed running python code in the metadata of a notebook or something? If not, can we add some comments to these cells and then add more spaces to the cells where we want students to add their homework? I'd suggest a blank cell or two above the cell where the answer should be and then the answer cell. it seems to remove all additional spaces.
When i run the cell with check("time-series-homework-wk-5/q-a34ccf2.py") it doesn't know how to find that function. Where is that function and are there standard imports that belong at the top of all notebooks?
here is the cell for plot 2. it seems to retain that call to grab the plot.
Can we customize the comment on cells where the solutions are hidden
I found the code in nbclean but am unsure if there is the ability to parse each cell. The alternative would be to allow for one comment to persist at the top of the cell.
Is there any way to maintain code in a cell - for instance like below grabbing the plot element. i think we need to do that as plt.show could break things. i'm not sure however.
Update: USER ERROR - I fixed this by using `###` rather than a single `#`
The text was updated successfully, but these errors were encountered:
The code below provides a solution for a student plot. At the bottom it has this
I believe that we need to grab the axis object and not call plt.show() but i'm not 100% sure. I am curious why that code disappeared for the first PLOT assignment cell of homework 5 but not for the second.
When i run the cell with
check("time-series-homework-wk-5/q-a34ccf2.py")
it doesn't know how to find that function. Where is that function and are there standard imports that belong at the top of all notebooks?here is the cell for plot 2. it seems to retain that call to grab the plot.
I found the code in nbclean but am unsure if there is the ability to parse each cell. The alternative would be to allow for one comment to persist at the top of the cell.
![screen shot 2018-12-17 at 4 01 06 pm](https://user-images.githubusercontent.com/7649194/50121180-259b1500-0215-11e9-9252-253bf0d4e9ed.png)
Update: USER ERROR - I fixed this by using `###` rather than a single `#`The text was updated successfully, but these errors were encountered: