site_columns = ['RecordID', 'SiteID', 'SiteName', 'Collaborative', 'Ratio',\ 'Time_Start', 'Tide_Start', 'Time_End', 'Tide_End', 'Date', 'Month',\ 'Day', 'Weather', 'Precipitation', 'Sea_State', 'Tide_State_Start',\ 'Tide_State_End', 'Visibility', 'Vis_Reason', 'Vis_Reason_Other',\ 'Equipment', 'NoActivity', 'Walkers', 'Dogs', 'Power_Boats',\ 'Unpowered_Boat', 'Other_Activity', 'PhotoFiles', 'YES_NO_WESA_Obs',\ 'Comments', 'Source'] site_infoOnline2017 = pd.DataFrame(online_2017.ix[:,site_columns]).copy() # Site info data frame from combineCountsFun import combineCounts ## Convert WESA counts to rows WESA_2017 = combineCounts(online_2017, "WESA") print("Null IDs from WESA. Should be empty\n", WESA_2017[pd.isnull(WESA_2017.ID)]) # Convert falcon columns to dataframe rows falc_2017 = combineCounts(online_2017, "Falcon") ## No observed Counts------------------------------------------ no_obs_Online2017 = site_infoOnline2017[site_infoOnline2017.YES_NO_WESA_Obs == "I did not observe any Western Sandpipers during the entire survey"] #'I saw at least 1 WESA during the survey'] columns_Iwant = ['RecordID','SiteID','Collaborative','Time_Start','Time_End','Date','Month','Day'] no_obs_Online2017_short = no_obs_Online2017.loc[:,columns_Iwant] no_obs_Online2017_short['Count'] = 0 # print(no_obs_Online2017_short.head()) no_obs_Online2017_short.to_csv(outputfolder + 'noObsOnline2017_Fra_Master.csv', sep = '\t')
# F_counts = online_2013.ix[:,F_count_col].copy() # F_counts.rename(columns=lambda x: re.sub('Falcon_\d*((_)|($))','',x), inplace=True) # F_counts.rename(columns={"": "Num_Falcons"}, inplace=True) # F_counts['F_CountNum'] = str(j) # #print(F_counts.columns.values) # if j == 1: F_Counts_All = F_counts # else: F_Counts_All = pd.concat([F_counts,F_Counts_All],ignore_index=True).copy() # #print(len(F_Counts_All)) # #print(F_Counts_All.columns.values) # #print(F_Counts_All.columns.values) # F_Counts_All['Group'] = 'Falcon' # F_Counts_All['ID'] = F_Counts_All['RecordID'] + '_F' + F_Counts_All['F_CountNum'] # F_Counts_All['Source'] = 'Online' from combineCountsFun import combineCounts Counts_All = combineCounts(online_2013, 'WESA') F_Counts_All = combineCounts(online_2013, 'Falcon') ### Extract manual data from Master Files manuallyEntered_2013 = pd.read_excel(masterfiles + "2013_ManuallyEntered.xlsx", sheetname=None, na_values=['NA']) ## ------------ Observer and Site Info ------------------------- observer_manual = pd.read_excel(masterfiles + "2013_ManuallyEntered.xlsx", sheetname='Observer Information', na_values=['NA'], skiprows=3) # manuallyEntered_2013['Observer Information'].copy() site_manual = pd.read_excel(masterfiles + "2013_ManuallyEntered.xlsx", sheetname='Site Information',