Notebook
biomassDF['Amphipoda']=biomassDF['Amphipoda']/8.5 biomassDF['Crabs']=biomassDF['Crabs']/8.5 biomassDF['Krill-Adult Juvenile']=biomassDF['Krill-Adult Juvenile']/8.5 biomassDF['Krill-Calyptopis']=biomassDF['Krill-Calyptopis']/8.5 biomassDF['Krill-Furcilia']=biomassDF['Krill-Furcilia']/8.5 biomassDF['Copepod']=biomassDF['Copepod']/8.5 biomassDF['Larvacea']=biomassDF['Larvacea']/8.5 biomassDF['Neocalanus']=(biomassDF['NEOCALANUS PLUMCHRUS']+biomassDF['NEOCALANUS CRISTATUS']+biomassDF['NEOCALANUS'])/8.5 biomassDF['Calanus']=(biomassDF['CALANUS PACIFICUS']+biomassDF['CALANUS MARSHALLAE'])/8.5 biomassDF['Metridia']=(biomassDF['METRIDIA PACIFICA']+biomassDF['METRIDIIDAE'])/8.5 biomassDF['Eucalanus']=(biomassDF['EUCALANUS BUNGII']+biomassDF['EUCALANUS CALIFORNICUS']+biomassDF['EUCALANUS'])/8.5 biomassDF['Calanoids']=(biomassDF['CALANOIDA']+biomassDF['NEOCALANUS PLUMCHRUS']+biomassDF['NEOCALANUS CRISTATUS']+biomassDF['NEOCALANUS']+biomassDF['CALANUS PACIFICUS']+biomassDF['CALANUS MARSHALLAE']+biomassDF['METRIDIA PACIFICA']+biomassDF['METRIDIIDAE']+biomassDF['EUCALANUS BUNGII']+biomassDF['EUCALANUS CALIFORNICUS']+biomassDF['EUCALANUS'])/8.5
#recreated groups below after model values were included in dataframe monthCala=biomassDF.groupby(['Sample Month', 'Calanoids'], as_index=False).mean() monthEuph=biomassDF.groupby(['Sample Month', 'Euphausiids'], as_index=False).mean() monthAmph=biomassDF.groupby(['Sample Month', 'Amphipods'], as_index=False).mean() monthCrab=biomassDF.groupby(['Sample Month', 'Crabs'], as_index=False).mean() monthNonCala=biomassDF.groupby(['Sample Month', 'NonCalanoids'], as_index=False).mean() monthLarv=biomassDF.groupby(['Sample Month', 'Larvaceans'], as_index=False).mean() monthGast=biomassDF.groupby(['Sample Month', 'Gastropods'], as_index=False).mean() monthJellies=biomassDF.groupby(['Sample Month', 'Jellies'], as_index=False).mean() monthTotal=biomassDF.groupby(['Sample Month', 'Total'], as_index=False).mean()#recreated figures below after model was included in dataframe fig,ax=plt.subplots(1,4,figsize=(20,5)) ax[0].plot(monthCala['Sample Month'],monthCala['Calanoids'],'r.') ax[1].plot(monthEuph['Sample Month'],monthEuph['Euphausiids'],'r.') ax[2].plot(monthAmph['Sample Month'],monthAmph['Amphipods'],'r.') ax[3].plot(monthCrab['Sample Month'],monthCrab['Crabs'],'r.') ax[0].set_title('Calanoid Seasonal Cycle') ax[1].set_title('Euphausiid Seasonal Cycle') ax[2].set_title('Amphipod Seasonal Cycle') ax[3].set_title('Decapod Seasonal Cycle') ax[0].set_xlim(0,13) ax[1].set_xlim(0,13) ax[2].set_xlim(0,13) ax[3].set_xlim(0,13) ax[0].set_ylim(0,10) ax[1].set_ylim(0,10) ax[2].set_ylim(0,10) ax[3].set_ylim(0,10) fig,ax=plt.subplots(1,4,figsize=(20,5)) ax[0].plot(monthNonCala['Sample Month'],monthNonCala['NonCalanoids'],'r.') ax[1].plot(monthLarv['Sample Month'],monthLarv['Larvaceans'],'r.') ax[2].plot(monthGast['Sample Month'],monthGast['Gastropods'],'r.') ax[3].plot(monthJellies['Sample Month'],monthJellies['Jellies'],'r.') ax[0].set_title('Non Calanoid Seasonal Cycle') ax[1].set_title('Larvacean Seasonal Cycle') ax[2].set_title('Gastropod Seasonal Cycle') ax[3].set_title('Jellies Seasonal Cycle') ax[0].set_xlim(0,13) ax[1].set_xlim(0,13) ax[2].set_xlim(0,13) ax[3].set_xlim(0,13) ax[0].set_ylim(0,10) ax[1].set_ylim(0,10) ax[2].set_ylim(0,10) ax[3].set_ylim(0,10)#recreated figures below after model was included in dataframe fig,ax=plt.subplots(1,1,figsize=(12,5)) ax.plot(monthTotal['Sample Month'],monthTotal['Total'],'.') ax.set_title('Total Zooplankton Seasonal Cycle') ax.set_xlim(0,13) ax.set_ylim(0,20)
data['L10Amphipoda']=logt(data['Amphipoda']) data['L10Crabs']=logt(data['Crabs']) data['L10Krill-Adult Juvenile']=logt(data['Krill-Adult Juvenile']) data['L10Krill-Calyptopis']=logt(data['Krill-Calyptopis']) data['L10Krill-Furcilia']=logt(data['Krill-Furcilia']) data['L10Copepod']=logt(data['Copepod']) data['L10Larvacea']=logt(data['Larvacea']) data['L10Eucalanus']=logt(data['Eucalanus']) data['L10Neocalanus']=logt(data['Neocalanus']) data['L10Metridia']=logt(data['Metridia']) data['L10Calanus']=logt(data['Calanus']) data['L10Calanoids']=logt(data['Calanoids']) data['L10mod_microzooplankton']=logt(data['mod_microzooplankton']) data['L10mod_mesozooplankton']=logt(data['mod_mesozooplankton'])
##Mean number of Calanoids grouped by sample month monthCala=data.groupby(['Sample Month', 'Calanoids'], as_index=False).mean() monthEuph=data.groupby(['Sample Month', 'Euphausiids'], as_index=False).mean() monthAmph=data.groupby(['Sample Month', 'Amphipods'], as_index=False).mean() monthCrab=data.groupby(['Sample Month', 'Crabs'], as_index=False).mean() monthNonCala=data.groupby(['Sample Month', 'NonCalanoids'], as_index=False).mean() monthLarv=data.groupby(['Sample Month', 'Larvaceans'], as_index=False).mean() monthGast=data.groupby(['Sample Month', 'Gastropods'], as_index=False).mean() monthJellies=data.groupby(['Sample Month', 'Jellies'], as_index=False).mean() monthModMicro=data.groupby(['Sample Month', 'mod_microzooplankton'], as_index=False).mean() monthModMeso=data.groupby(['Sample Month', 'mod_mesozooplankton'], as_index=False).mean()
##sample R code for geometric mean conversion of log values #geoMean <- function(x, ...){ # xlog <- log(x) # exp(mean(xlog[is.finite(xlog)])) #}