I have a tremendous list of coordinates in which i wish to count how many times a certain X appears. I use count and found accidentally, that in a loop script and individually, it gives wrong results certain values... I shal post the list at the end because it is long (1000 points).
My loop script should return to me how many times any one appears:
demo2 = Reap[
Do[Clear[dummy3];
dummy3 =
Count[
tabelsav[[All, 1]], i]; If[dummy3 == 0, Continue,
Sow[{i, dummy3}]],
{i, 0, 10, 0.01}]]
This returns a correct (seemingly) list where a particular value, 0.95 appears 4 times as it should. However if i ask just:
Count[tabelsav[[All, 1]], 0.95]
I get an answer 0...
I cannot explain this discrepancy.
The long source-list is:
tabelsav = {{0.81`, 0.5109462100846561`}, {1.3`,
0.5048072687790746`}, {1.61`, 0.5010869822978168`}, {2.95`,
0.5019252231248612`}, {7.7`, 0.5031009140137692`}, {1.36`,
0.501960184855639`}, {3.63`, 0.5001125487449931`}, {1.35`,
0.5033465830176649`}, {3.`, 0.5028139472844518`}, {2.42`,
0.500744556085373`}, {8.44`,
0.503866318664603`}, {0.9500000000000001`,
0.50323521089743`}, {9.53`, 0.5093581725292053`}, {4.75`,
0.5008881290304839`}, {2.33`, 0.5036601072538167`}, {3.22`,
0.5063466060976247`}, {9.05`, 0.5040083800013683`}, {7.72`,
0.5063431323886172`}, {0.88`,
0.5011011047670997`}, {4.0200000000000005`,
0.5028218805839639`}, {1.04`, 0.5011978901324959`}, {2.99`,
0.5101814443088554`}, {1.73`, 0.5021968961092514`}, {1.05`,
0.5040744761035159`}, {2.11`, 0.5021756107938509`}, {5.05`,
0.5000857792289806`}, {3.2600000000000002`,
0.5084904752220928`}, {1.42`, 0.5025388409352449`}, {9.57`,
0.5052046775360528`}, {1.18`,
0.5010234800254477`}, {4.6000000000000005`,
0.5000999647189075`}, {9.39`, 0.5007412512678611`}, {0.63`,
0.5077966238805889`}, {4.5200000000000005`,
0.5062010476131855`}, {0.89`, 0.5049669240401983`}, {4.28`,
0.5032637763749983`}, {1.41`, 0.5022525486137775`}, {0.89`,
0.5000193756828281`}, {5.82`, 0.5051011473483499`}, {1.32`,
0.5009934059766663`}, {4.94`, 0.5082684668663134`}, {3.95`,
0.5041504627396654`}, {4.64`, 0.5112623897085815`}, {5.64`,
0.5065690511624643`}, {5.22`, 0.5041508418690306`}, {9.74`,
0.5031308760002466`}, {8.9`, 0.500217532478172`}, {7.4`,
0.5045464565085634`}, {3.8000000000000003`,
0.5001922739885245`}, {2.02`, 0.5015750517902692`}, {4.21`,
0.5019770775727549`}, {1.36`, 0.5013158499000089`}, {5.66`,
0.5034607143512423`}, {2.32`, 0.5016779867287418`}, {1.07`,
0.5054164430851992`}, {8.620000000000001`,
0.5055408077588736`}, {1.96`,
0.5027274565056948`}, {0.8200000000000001`,
0.5031947382858473`}, {5.14`, 0.5009631756259397`}, {1.24`,
0.5018812890717584`}, {9.4`, 0.5059872970133213`}, {3.38`,
0.5039103146189894`}, {3.18`, 0.5072475864421937`}, {7.66`,
0.5042209593945588`}, {5.94`, 0.5041780109744176`}, {7.84`,
0.5031076143699232`}, {0.89`,
0.5072574364040147`}, {1.1300000000000001`,
0.5070123711835102`}, {7.5600000000000005`,
0.5001417068696901`}, {0.72`, 0.5008013996326409`}, {0.76`,
0.5004866756883766`}, {1.02`,
0.5001265136641909`}, {5.1000000000000005`,
0.5033439301179092`}, {4.3100000000000005`,
0.5006210221598733`}, {3.02`, 0.5028748025251597`}, {1.76`,
0.5010330744072706`}, {1.94`, 0.5109598585807998`}, {5.05`,
0.5018754496005065`}, {3.45`,
0.5006893194185126`}, {5.0200000000000005`,
0.5003116980927497`}, {4.73`, 0.5026952432619735`}, {2.31`,
0.5019835103454474`}, {1.1400000000000001`,
0.5026526911993401`}, {5.0600000000000005`,
0.5033990031948213`}, {8.56`, 0.5003628830728191`}, {5.4`,
0.501827007325571`}, {2.97`, 0.5013909391635281`}, {1.03`,
0.5063933382277723`}, {1.33`, 0.5029672522568759`}, {4.49`,
0.5031500004292724`}, {5.21`, 0.5036030658004264`}, {5.03`,
0.5045007462822559`}, {3.34`, 0.5009009067256426`}, {2.33`,
0.502683252130243`}, {2.05`,
0.5028873973041389`}, {1.4000000000000001`,
0.5059338026247351`}, {6.42`,
0.5022032303965346`}, {0.7000000000000001`,
0.5024043005413459`}, {2.08`, 0.5037600808508966`}, {9.07`,
0.5013947967013694`}, {1.6400000000000001`,
0.5024621241310729`}, {1.78`, 0.5039479519862525`}, {3.54`,
0.5070104903057179`}, {0.9`, 0.5057995693100946`}, {1.2`,
0.5005837436594683`}, {7.19`,
0.5076759763851902`}, {0.9500000000000001`,
0.5057819262070574`}, {5.65`, 0.5096431980239409`}, {6.32`,
0.5014264793833055`}, {4.98`, 0.5036648306874812`}, {1.54`,
0.5039311805939243`}, {1.6500000000000001`,
0.5008706573615119`}, {7.21`, 0.5015512501592116`}, {1.`,
0.5008625411142199`}, {2.59`, 0.5003932303291205`}, {0.9`,
0.5042075673417277`}, {1.37`, 0.5032638234391172`}, {8.51`,
0.5004540503043337`}, {5.57`, 0.5053402244041116`}, {6.8`,
0.5006723513383826`}, {1.06`, 0.5025698211769374`}, {1.21`,
0.5023855529207454`}, {3.8000000000000003`,
0.505914578919494`}, {3.44`,
0.5017239835562792`}, {3.0300000000000002`,
0.5022346213766277`}, {5.1000000000000005`,
0.5011655501234785`}, {5.1000000000000005`,
0.5061064362225602`}, {6.46`, 0.5020053134452778`}, {1.87`,
0.5036316344435962`}, {8.85`, 0.5071278559381912`}, {7.49`,
0.501531568693161`}, {2.06`, 0.5058045753619874`}, {5.59`,
0.5017009176358966`}, {4.48`, 0.5057065740138614`}, {0.72`,
0.5082500569165581`}, {0.9500000000000001`,
0.5039844166432038`}, {6.69`,
0.5038784676602129`}, {1.3900000000000001`,
0.5009486184443135`}, {4.68`, 0.5005596940476884`}, {2.13`,
0.5019978689344542`}, {4.15`, 0.5154384705795821`}, {6.75`,
0.5059854595934982`}, {0.99`, 0.5067948432930836`}, {4.18`,
0.5060636823095165`}, {7.12`, 0.5016927529829089`}, {1.59`,
0.5017673618057692`}, {0.88`, 0.5017205659974725`}, {1.49`,
0.5070437931065557`}, {0.71`, 0.5053672223303575`}, {0.98`,
0.5038250885415472`}, {3.18`, 0.5017874096084308`}, {0.87`,
0.5089700052509033`}, {1.77`, 0.501416753797174`}, {1.19`,
0.5037659967971813`}, {0.8300000000000001`,
0.5101486883056678`}, {4.24`, 0.5017325256509887`}, {5.79`,
0.5054443661367897`}, {9.23`, 0.5093651148490717`}, {1.33`,
0.5009917503061815`}, {6.0600000000000005`,
0.5092699934378212`}, {2.12`, 0.5073881728088648`}, {9.24`,
0.5029793903961434`}, {0.87`, 0.5050296353749212`}, {5.71`,
0.5032880878265164`}, {4.68`, 0.50051683895868`}, {2.92`,
0.5031438215969047`}, {4.5200000000000005`,
0.507039907981513`}, {7.5200000000000005`,
0.5057058632368994`}, {5.3500000000000005`,
0.5006420640899709`}, {6.03`, 0.5028173959063368`}, {1.21`,
0.5077444901612066`}, {0.87`, 0.509370820189887`}, {3.38`,
0.5017678147904528`}, {8.21`, 0.5023072108120711`}, {1.72`,
0.5033980577659639`}, {1.26`, 0.5058064721029873`}, {1.21`,
0.5044717093814677`}, {1.57`,
0.5012283991549582`}, {3.2600000000000002`,
0.5008714353301591`}, {3.9`, 0.5046836821554793`}, {3.71`,
0.50749085777909`}, {4.86`, 0.5025110408732278`}, {5.86`,
0.504195370319043`}, {1.03`, 0.5009897144061476`}, {3.23`,
0.5020818305488777`}, {1.06`, 0.5037426774713709`}, {2.99`,
0.5028930101703603`}, {9.58`, 0.5001418570249581`}, {8.6`,
0.5032008473213024`}, {1.05`, 0.5031112828622336`}, {5.79`,
0.5036122947579244`}, {7.63`,
0.5028723174583136`}, {1.6500000000000001`,
0.5025748394625876`}, {8.39`, 0.5126932395095996`}, {1.8`,
0.5027458364819463`}, {4.63`, 0.5016982616830904`}, {5.47`,
0.5004066478872781`}, {6.4`, 0.5008329010607683`}, {3.4`,
0.5064779705236596`}, {2.47`, 0.5012878133541617`}, {2.67`,
0.5033263252802949`}, {9.86`, 0.503900737442421`}, {4.79`,
0.5103801481318953`}, {1.04`, 0.508046923457422`}, {0.84`,
0.5094401342091538`}, {7.25`, 0.5008265212688686`}, {4.04`,
0.5032506361276915`}, {1.45`, 0.5002579933952799`}, {1.18`,
0.5005671576943244`}, {1.6400000000000001`,
0.5028579181703327`}, {0.74`, 0.507588931964315`}, {3.84`,
0.5020519751581894`}, {4.7700000000000005`,
0.5088310521898424`}, {1.48`, 0.5002018342287672`}, {0.89`,
0.5112377017968762`}, {2.27`,
0.5034614169222869`}, {4.0200000000000005`,
0.5039010521110797`}, {3.86`, 0.5022777899515114`}, {0.87`,
0.5009916597355644`}, {1.33`,
0.5004231294167313`}, {8.120000000000001`,
0.5007312935604318`}, {5.03`, 0.5025158180571903`}, {5.8`,
0.5022372577051709`}, {5.9`, 0.5005237589894902`}, {8.07`,
0.5092973099237901`}, {9.120000000000001`,
0.5018064400737199`}, {3.62`, 0.5014996810167306`}, {4.41`,
0.5013437649995602`}, {1.17`, 0.5056746389026118`}, {3.84`,
0.5034965981253541`}, {2.77`,
0.5122030052133616`}, {6.1000000000000005`,
0.501659971135687`}, {3.5100000000000002`,
0.5043663274858946`}, {8.77`, 0.5011189361653974`}, {5.21`,
0.5012379833159547`}, {8.39`, 0.5017612953951748`}, {2.27`,
0.5094715558734839`}, {8.01`, 0.5068175002427142`}, {3.64`,
0.5019872086788807`}, {3.5`, 0.5003063452767259`}, {5.45`,
0.5041167357214407`}, {6.2`, 0.5012274271254351`}, {7.32`,
0.5030277100739914`}, {3.18`,
0.5015713801171047`}, {5.8500000000000005`,
0.5087080700527293`}, {1.54`, 0.5019921455670423`}, {3.93`,
0.5003463520296838`}, {5.3100000000000005`,
0.5000460318009461`}, {0.8200000000000001`,
0.5084306384161053`}, {0.87`, 0.5032408112284076`}, {1.03`,
0.5006433241835044`}, {2.5`, 0.502739540042087`}, {4.18`,
0.5023724970546544`}, {3.`, 0.5062418050883324`}, {0.88`,
0.5046989551933203`}, {3.93`, 0.5019258493392756`}, {6.7`,
0.5011817479922397`}, {7.84`, 0.5045093237303065`}, {2.68`,
0.5022300283961209`}, {6.63`, 0.5005368434047653`}, {7.58`,
0.504998173761705`}, {3.49`, 0.505626758641359`}, {2.13`,
0.502538829740494`}, {1.46`, 0.5057436402499756`}, {3.85`,
0.5000824763551935`}, {3.5500000000000003`,
0.5018664353073353`}, {3.87`, 0.5001919876430388`}, {3.13`,
0.5020499033634109`}, {2.37`, 0.5016400757328934`}, {2.59`,
0.5015239999780767`}, {6.53`, 0.5006370028352829`}, {2.54`,
0.5002220569112746`}, {2.98`,
0.5024630480954935`}, {0.8200000000000001`,
0.5031855589823996`}, {7.21`, 0.503005467629622`}, {2.7`,
0.5027968593586135`}, {1.27`, 0.5003124488131474`}, {1.18`,
0.5005507564765506`}, {1.49`, 0.5039643828425076`}, {2.84`,
0.5000180470968303`}, {1.22`, 0.5000151569629644`}, {1.12`,
0.501638426184796`}, {3.49`, 0.5004662739476854`}, {0.91`,
0.5034400062583759`}, {3.24`, 0.503344295854238`}, {2.92`,
0.5011596358547996`}, {8.51`, 0.5002193235795764`}, {6.26`,
0.5070106765591609`}, {3.48`, 0.502403540043892`}, {0.74`,
0.503763104586026`}, {2.36`, 0.5023821090492947`}, {1.31`,
0.5061012784481049`}, {2.47`, 0.5021948467830896`}, {1.83`,
0.507019869215177`}, {1.53`, 0.5023948453949935`}, {0.92`,
0.5049496529631803`}, {5.21`, 0.500756502811317`}, {0.6`,
0.507006122269764`}, {3.81`, 0.502315817634428`}, {0.92`,
0.505159948394197`}, {2.57`, 0.5017976786426525`}, {7.43`,
0.5011997680779028`}, {7.67`, 0.5005309669549508`}, {1.25`,
0.5047793616284166`}, {3.19`, 0.5010006683685084`}, {9.43`,
0.5008618019224559`}, {4.76`, 0.5007625124991477`}, {9.01`,
0.5041063160032132`}, {5.67`, 0.5002854120655155`}, {0.93`,
0.500257600075891`}, {0.9`, 0.5064687392974402`}, {1.26`,
0.5065946381018079`}, {3.49`, 0.501497039242547`}, {3.88`,
0.5017394902940288`}, {6.12`, 0.5014136584433144`}, {1.94`,
0.5089918218244472`}, {6.69`, 0.5005444002434879`}, {2.47`,
0.5033671288673328`}, {1.9000000000000001`,
0.5004675627088869`}, {5.25`,
0.5028701949011372`}, {1.6400000000000001`,
0.5042329315477915`}, {5.9`, 0.5005602457136121`}, {1.18`,
0.5028041884273412`}, {2.23`, 0.5048398044728458`}, {3.35`,
0.5057278578876744`}, {5.04`, 0.5071007057125294`}, {2.64`,
0.5029458704151538`}, {4.78`, 0.5013207931197564`}, {0.75`,
0.5000817041493955`}, {0.88`, 0.5017168883186924`}, {1.25`,
0.5060153097998106`}, {2.2800000000000002`,
0.5014708508791023`}, {0.8300000000000001`,
0.5011748831260362`}, {0.63`, 0.5040830855164764`}, {4.96`,
0.5004888697129709`}, {9.89`, 0.5020337081874794`}, {3.04`,
0.5029412425581916`}, {6.04`, 0.5055105956871854`}, {9.84`,
0.5012223857558749`}, {5.59`, 0.5036566134207263`}, {1.42`,
0.509785076498579`}, {4.82`, 0.5162990704393645`}, {9.91`,
0.500080075846436`}, {0.97`, 0.505998632027506`}, {2.37`,
0.5022308389113287`}, {5.04`, 0.5012231837259915`}, {2.08`,
0.5003527112362756`}, {7.8`, 0.5004431915871477`}, {8.9`,
0.5051826496589197`}, {9.93`, 0.5064385454179643`}, {7.15`,
0.502738559523307`}, {3.37`, 0.5009242739426236`}, {4.66`,
0.5008532069295164`}, {2.67`, 0.50051267354687`}, {9.85`,
0.5043266824689545`}, {1.03`,
0.5025006675871861`}, {0.9500000000000001`,
0.5056520506364827`}, {3.41`, 0.5004143481728401`}, {1.35`,
0.5020466036800005`}, {3.39`, 0.5027192313237163`}, {2.41`,
0.5101925844197512`}, {9.13`, 0.5002216690576016`}, {3.18`,
0.5021529878310833`}, {0.88`, 0.5018548355264083`}, {2.92`,
0.5018645227226244`}, {5.36`, 0.5074683846278654`}, {0.8`,
0.5022530550884748`}, {6.29`, 0.5003193989130776`}, {1.`,
0.5005060489124801`}, {4.2700000000000005`,
0.5038813436903959`}, {9.92`, 0.5028624052059641`}, {7.17`,
0.5017759977306311`}, {5.48`, 0.5008863974643626`}, {4.83`,
0.5015365478812477`}, {0.65`, 0.5086793365224469`}, {2.77`,
0.5004031827924348`}, {1.86`, 0.5018055949396782`}, {5.55`,
0.5038992912562512`}, {3.66`, 0.5057939678089606`}, {8.25`,
0.5129646657679212`}, {1.18`, 0.5034658252678281`}, {0.71`,
0.5040046067290045`}, {3.27`, 0.5093106554628457`}, {1.45`,
0.5005018998272578`}, {8.59`, 0.500215754936234`}, {3.74`,
0.5021207903645754`}, {1.44`, 0.501660438319052`}, {5.01`,
0.5079123602372846`}, {0.79`, 0.5054434721907501`}, {0.65`,
0.5036054711414452`}, {6.140000000000001`,
0.5039809222996585`}, {1.1`,
0.5049976513196622`}, {3.3200000000000003`,
0.5070530373996325`}, {7.140000000000001`,
0.5024051710238404`}, {1.27`, 0.5070039228079133`}, {6.21`,
0.5028698955886769`}, {6.6000000000000005`,
0.5004591989022191`}, {0.9400000000000001`,
0.5001516853579012`}, {1.42`, 0.5006411020404911`}, {4.39`,
0.50225303658142`}, {5.63`, 0.504666226611208`}, {0.9`,
0.5019914369672841`}, {0.85`, 0.5003866401775756`}, {0.99`,
0.5050402628743712`}, {1.43`,
0.5016992188610021`}, {1.1500000000000001`,
0.5079240350014476`}, {5.62`, 0.5019499481941615`}, {9.72`,
0.5084674024947616`}, {8.15`, 0.5049303759519219`}, {3.66`,
0.5071942524274655`}, {3.6`, 0.5001416538810785`}, {0.88`,
0.5010537688689856`}, {2.47`, 0.5019405289225632`}, {4.22`,
0.5019929653938368`}, {1.67`,
0.5068346745326957`}, {2.8000000000000003`,
0.5010614774579043`}, {9.4`, 0.5013242746881199`}, {3.62`,
0.5047454409720712`}, {4.17`, 0.5078313969011182`}, {1.59`,
0.5013554357778294`}, {6.44`, 0.502685397305827`}, {7.46`,
0.5043204917942756`}, {5.97`, 0.5041177645588811`}, {3.44`,
0.5009220456042716`}, {5.18`, 0.5023526001125401`}, {0.86`,
0.5035403474490506`}, {9.370000000000001`,
0.501579854877451`}, {5.13`, 0.5012253166720193`}, {6.18`,
0.509017273276933`}, {8.51`, 0.5028909866638978`}, {6.01`,
0.5020226616681036`}, {1.41`, 0.5012504249463967`}, {2.6`,
0.5006826684943488`}, {4.01`, 0.503505723593163`}, {3.69`,
0.5041394263856391`}, {8.92`, 0.5093153307844197`}, {0.8`,
0.5050079979273715`}, {5.95`, 0.5009376343970858`}, {7.19`,
0.5055472235776275`}, {2.34`, 0.5010473541089691`}, {3.37`,
0.5012419557026758`}, {2.56`, 0.5038777478171406`}, {4.08`,
0.5026440554427228`}, {4.34`, 0.5031640510414119`}, {1.35`,
0.5002367789245368`}, {1.96`, 0.5032953567650386`}, {0.9`,
0.5038040981378148`}, {4.04`, 0.5001311229781609`}, {7.07`,
0.5003169204803635`}, {3.31`, 0.5045835067676754`}, {4.`,
0.5047650884989524`}, {0.73`, 0.5051620156614615`}, {1.55`,
0.5022065285594012`}, {7.82`,
0.501402949453368`}, {6.140000000000001`,
0.5010417892525576`}, {1.92`, 0.503464175916745`}, {4.34`,
0.5026307057896082`}, {2.98`, 0.5025886071719675`}, {5.73`,
0.500352260918296`}, {8.76`, 0.5030789103847021`}, {1.05`,
0.51022840062377`}, {5.95`, 0.5004557300514152`}, {1.01`,
0.500612260195006`}, {1.68`, 0.5040112290280655`}, {0.79`,
0.5052569443605351`}, {0.85`,
0.5022996609267956`}, {9.200000000000001`,
0.5011435590125549`}, {4.76`, 0.504660914958012`}, {6.19`,
0.5020147089796605`}, {3.74`, 0.5036934319319413`}, {3.02`,
0.505852699748288`}, {8.6`, 0.5014550323487886`}, {9.36`,
0.5033034424084099`}, {0.87`, 0.505585543645097`}, {1.19`,
0.5091565563623018`}, {2.91`, 0.504597445242694`}, {0.79`,
0.5110127560897401`}, {1.99`,
0.5018154310758559`}, {6.0200000000000005`,
0.5001081646829765`}, {9.78`, 0.5089681423482492`}, {5.15`,
0.5028681026560692`}, {0.81`, 0.502404213383239`}, {2.49`,
0.5027075653734441`}, {0.77`, 0.5031261200003118`}, {0.81`,
0.5095313223852878`}, {5.54`, 0.501902483148226`}, {6.33`,
0.5030901279090607`}, {2.32`, 0.5031953692824397`}, {1.8`,
0.5055503409759046`}, {7.87`, 0.509365706814609`}, {1.45`,
0.5044185877771425`}, {0.84`,
0.5008919585649368`}, {4.5600000000000005`,
0.500386262707069`}, {1.6600000000000001`,
0.5007464937698282`}, {1.44`, 0.5010127723874596`}, {9.74`,
0.5031551304132433`}, {4.32`, 0.5010416751840887`}, {7.21`,
0.501462901252289`}, {1.09`,
0.5087557702622477`}, {8.040000000000001`,
0.5001203493042328`}, {3.15`, 0.5003145130543539`}, {8.73`,
0.5036964915455299`}, {1.1500000000000001`,
0.5050953554650189`}, {9.35`, 0.5072877824517771`}, {3.1`,
0.5000278609908476`}, {2.7800000000000002`,
0.5004115091697551`}, {6.71`, 0.5002300328077767`}, {2.43`,
0.5013323077384152`}, {6.3100000000000005`,
0.5005694159556053`}, {0.91`, 0.5049928109696685`}, {4.82`,
0.5009403511151124`}, {1.`, 0.5023532502895675`}, {2.`,
0.5048067395609089`}, {7.24`, 0.5065146690614348`}, {4.16`,
0.5025327294769528`}, {0.96`, 0.5074742744336952`}, {6.69`,
0.5002380238879927`}, {6.0200000000000005`,
0.5020107612761264`}, {1.69`, 0.5040332742057951`}, {7.97`,
0.5000617413417427`}, {2.09`, 0.5022823581279093`}, {0.73`,
0.5009663552401961`}, {4.37`, 0.5051543767548864`}, {6.07`,
0.5007999942246505`}, {0.65`, 0.5107966156096774`}, {8.32`,
0.5034165472290095`}, {6.41`, 0.5014854922860411`}, {1.41`,
0.5072954739224551`}, {6.33`, 0.5000001992225086`}, {1.07`,
0.5034706016464965`}, {1.97`, 0.5005196008574128`}, {7.95`,
0.503546268179625`}, {8.49`, 0.5035228959056488`}, {7.38`,
0.5035208302561678`}, {7.34`, 0.509467663946227`}, {4.13`,
0.5064034573057505`}, {1.04`, 0.5043103810857164`}, {5.13`,
0.5013125945427757`}, {5.26`, 0.5006947636021745`}, {4.57`,
0.5012116821991728`}, {7.8`, 0.5085483556324307`}, {6.33`,
0.5036915499735362`}, {7.45`, 0.5011122663327268`}, {1.3`,
0.5045147661736676`}, {1.18`,
0.5012468552973133`}, {1.3900000000000001`,
0.5029222574858631`}, {3.42`,
0.5028626295358313`}, {5.8100000000000005`,
0.5046357114157952`}, {3.89`, 0.5013938727271786`}, {6.74`,
0.5022545431999902`}, {1.23`, 0.5000121998018545`}, {7.67`,
0.5039106302399582`}}
Edit01: I now used two steps to correct the precision issue:
1) round2[x_, n_] := Floor[10^n x]/10^n // N
2) tabelsav2 = round2[tabelsav, 2]
Count[tabelsav2[[All, 1]], 0.94]
Gives the answer 1 and
Count[tabelsav2[[All, 1]], 0.95]
Gives the answer 4
However a slightly modified code (just to see if a different module works) now gives a completely differently wrong result:
tabelmod = {};
Do[
If[
MemberQ[tabelsav2[[All, 1]], i] == True,
AppendTo[tabelmod, {i, Count[tabelsav2[[All, 1]], i]}],
Continue],
{i, 0, k*h1, h1}]
where k=1000 and h1=0.01 (timestep). In tabelmod there is no 0.94 or 0.95 component...
0.9500000000000001
` shows up in your list. $\endgroup$demo2
you take the values to be counted fromtabelsav
itself, i.e. values really existing in the list. Look closely - you'll see there's no0.95
- there's an0.9500000000000001
, which is not the same. So,Count[tabelsav[[All, 1]], 0.95]
correctly says there's no0.95
. $\endgroup$round2[x_, n_] := Floor[10^n x]/10^n // N
andtabelsav2 = round2[tabelsav, 2]
to produce the table i want... BUT now its even worse... now the 0.95 doesnt show up in the loop! It does however if i specifically ask it through Count... what gives? $\endgroup$MemberQ[Table[i, {i, 0, k*h1, h1}], 0.95]
givesFalse
, because0.01*95 =!= 0.95
-- see here. You could doround2[x_, n_] := Floor[10^n x]/10^n; tabelsav2 = round2[tabelsav, 2]; k = 1000; h1 = 1/100;
then createtabelmod
(runN
on it afterwards) and see that there are4.
occurences of0.95
. $\endgroup$