Skip to main content
deleted 16 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] strtolist3 = IntegerPart @ Map[Internal`StringToDouble, StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[@..].

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] strtolist3 = IntegerPart @ Map[Internal`StringToDouble, StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] strtolist3 = IntegerPart @ Map[Internal`StringToDouble, StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as For loop with IntegerPart/@Internal`StringToDouble/@...

deleted 100 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] 

or make Internal`StringToDouble Listable:

istd = Internal`StringToDouble;  SetAttributes[istd, Listable] ; strtolist3 = IntegerPart @ Map[istdMap[Internal`StringToDouble,  StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] 

or make Internal`StringToDouble Listable:

istd = Internal`StringToDouble;  SetAttributes[istd, Listable] ; strtolist3 = IntegerPart @ Map[istd, StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] strtolist3 = IntegerPart @ Map[Internal`StringToDouble,  StringSplit[StringData[[All, 2]], ","], {-1}]; strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

added 240 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] 

or make Internal`StringToDouble Listable:

istd = Internal`StringToDouble; SetAttributes[istd, Listable] ; strtolist3 = IntegerPart @ Map[istd, StringSplit[StringData[[All, 2]], ","], {-1}];  strtolist3 == strtolist2 == strtolist 

True

isBoth are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] strtolist2 == strtolist 

True

is about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

strtolist2 = Map[FromDigits, StringSplit[StringData[[All, 2]], ","], {-1}] 

or make Internal`StringToDouble Listable:

istd = Internal`StringToDouble; SetAttributes[istd, Listable] ; strtolist3 = IntegerPart @ Map[istd, StringSplit[StringData[[All, 2]], ","], {-1}];  strtolist3 == strtolist2 == strtolist 

True

Both are about twice as fast as the For loop with IntegerPart/@Internal`StringToDouble/@StringSplit[..]

Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
Loading