本文整理汇总了Python中mean_sightings.get_sightings函数的典型用法代码示例。如果您正苦于以下问题:Python get_sightings函数的具体用法?Python get_sightings怎么用?Python get_sightings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_sightings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_water_is_correct
def test_water_is_correct():
watrec, watmean = get_sightings(filename,'water')
assert watrec==2, 'Number of records for water is wrong'
assert watmean==17, 'Mean for water is wrong'
示例2: test_not_present
def test_not_present():
norec, nomean = get_sightings(filename, 'Not Present')
assert norec == 0, 'Biosigniture not present'
assert nomean==0, 'Mean is not present'
示例3: test_anonymouse_is_correct
def test_anonymouse_is_correct():
anirec, animean = get_sightings(filename, 'NotPresent')
assert anirec == 0, 'Number of anonymous records is wrong'
assert animean == 0 , 'Mean for anonymous animal rec is wrong'
示例4: test_Mouse_is_correct
def test_Mouse_is_correct():
mouserec, mousemean = get_sightings(filename, 'Mouse')
assert mouserec == 12, 'Mouse number wrong'
assert mousemean == 1, 'Mouse mean wrong'
示例5: test_owl_is_correct
def test_owl_is_correct():
owlrec, owlmean = get_sightings(filename, 'Owl')
# assert test_statement message_if_test_is_false
assert owlrec == 2, 'Number of records for owl is wrong'
assert owlmean == 17#, 'Mean sightings for owl is wrong'
示例6: test_nothing_is_correct
def test_nothing_is_correct():
norec, nomean = get_sightings(filename, 'NotPresent')
assert norec == 0, 'Biosignature missing should return zero records'
assert nomean == 0, 'Biosignature missing should return zero mean'
示例7: test_Muskox_is_correct
def test_Muskox_is_correct():
muskrec, muskmean = get_sightings(filename, 'Muskox')
assert muskrec == 2, 'Number of records for Muskox is wrong'
assert muskmean == 25.5, 'Mean sightings for Muskox is wrong'
示例8: test_animal_not_present
def test_animal_not_present():
animrec, animmean = get_sightings(filename, 'NotPresent')
assert animrec == 0, 'Animal missing should return zero records'
assert animmean == 0, 'Animal missing should return zero mean'
示例9: get_sightings
figFILE = os.path.join(outDIR,'spp_fig.png')
# Set names of species to count
spp_names = ['Fox', 'Wolf', 'Grizzly', 'Wolverine']
# ------------------------------------------------------------------------
# Perform analysis
# ------------------------------------------------------------------------
# Declare empty list to hold counts of records
spp_recs = []
# Get total number of records for each species
for spp in spp_names:
totalrecs, meancount = get_sightings(dataFILE, spp)
spp_recs.append(totalrecs)
print('spp_names')
print( spp_names )
print('spp_recs')
print( spp_recs )
print('[spp_names, spp_recs]')
print( [spp_names, spp_recs] )
print('np.transpose([spp_names, spp_recs])')
print( np.transpose([spp_names, spp_recs]) )
# ------------------------------------------------------------------------
示例10: get_sightings
fig_name = 'spp_fig.png'
# Set names of species to count
spp_names = ['Fox', 'Wolf', 'Grizzly', 'Wolverine']
# ------------------------------------------------------------------------
# Perform analysis
# ------------------------------------------------------------------------
# Declare empty list to hold counts of records
spp_recs = []
# Get total number of records for each species
for spp in spp_names:
totalrecs, meancount = get_sightings(data_dir + data_name, spp)
spp_recs.append(totalrecs)
print spp_names
print spp_recs
# ------------------------------------------------------------------------
# Save results as table
# ------------------------------------------------------------------------
# Put two lists into a pandas DataFrame
table = pd.DataFrame(np.array(zip(spp_names, spp_recs),
dtype=[('species', 'S12'), ('recs', int)]))
# Save DataFrame as csv
table.to_csv(results_dir + table_name, index=False)
示例11: test_clay_is_corrrect
def test_clay_is_corrrect():
clayrec,claymean = get_sightings(filename,"Clay")
assert clayrec==2, "number of records for clay is wrong"
assert claymean==25.5, "clay mean is wrong"
示例12: test_water_is_corrrect
def test_water_is_corrrect():
watrec,watmean = get_sightings(filename,"Water")
assert watrec==2, "number of records for water is wrong"
assert watmean==17, "water mean is wrong"
示例13: test_not_present
def test_not_present():
norec,nomean = get_sightings(filename, "not present")
assert norec==0, "Biosig not present"
assert nomean ==0, "mean is not present"
示例14: test_pig_is_correct
def test_pig_is_correct():
pigrec, pigmean = get_sightings(filename, 'Pig')
assert pigrec == 1, 'Number of records for Pig is wrong'
assert pigmean == 4, 'Mean sightings for Pig is wrong'
示例15: test_not_present
def test_not_present():
norec,nomean = get_sightings(file,'Not present')
assert norec == 0, 'Biosignature not present, has zero recs.'
assert nomean == 0, 'Mean is not present for missing Biosig.'