Here is how I would do it: https://play.golang.org/p/-aSfOYst6w
-s sent from my droid On Dec 6, 2017 8:03 PM, "Jonathan Yu" <jonathan.i...@gmail.com> wrote: > > > 2017-12-06 10:38 GMT-08:00 Christian LeMoussel <cnh...@gmail.com>: > >> I have to write a Python program that uses numpy in GO. >> I have this Python code : >> prefix = "de98671db1ce0e5c9ba89ab7ccdca6c427460295b8dd3642e9b2bb96172 >> 3307c57629b1ad37909a863a56965" >> prefix_np = np.fromstring(prefix[0:64], dtype=np.uint32, count=16) >> print("prefix_np: {}".format(prefix_np)) >> >> Output : >> >> prefix_np: [ 943285604 1680946998 1700999522 1664443696 945906233 >> 929194297 1667523427 878917217 909391666 892940848 1684289634 842282547 >> 845298021 909730402 858928945 1664561203] >> >> >> Some idea how can I do this efficiently in GO ? >> > > I guess this would depend on whether this is a well-defined format; you > might have to port numpy's fromstring to Go? But it should be possible... > If you control the Python side, it might be easier to dump the data as JSON > and import into Go that way. > > Is there a library equivalent to numpy in GO? >> > > I'm not knowledgeable enough to say, but Go has gonum which has similar > goals to numpy and other data science toolkits: https://github.com/ > gonum/gonum > >> >> >> >> Thank you for your help >> G >> M >> T >> Détecter la langueAfrikaansAlbanaisAllemandAnglaisArabeArménienAzériBasq >> ueBengaliBiélorusseBirmanBosniaqueBulgareCatalanCebuanoChichewaChinois >> (Simp)Chinois (Trad)CingalaiCoréenCréole haïtienCroateDanoisEspagnolEsp >> érantoEstonienFinnoisFrançaisGalicienGalloisGéorgienGoudjaratiGrecHaoussa >> HébreuHindiHmongHongroisIgboIndonésienIrlandaisIslandaisItalienJaponais >> JavanaisKannadaKazakhKhmerLaotienLatinLettonLituanienMacédonienMalaisien >> MalayalamMalgacheMaltaisMaoriMarathiMongolNéerlandaisNépalaisNorvégien >> OuzbekPanjabiPersanPolonaisPortugaisRoumainRusseSerbeSesothoSlovaque >> SlovèneSomaliSoudanaisSuédoisSwahiliTadjikTagalogTamoulTchèqueTeluguThaï >> TurcUkrainienUrduVietnamienYiddishYoroubaZoulou >> AfrikaansAlbanaisAllemandAnglaisArabeArménienAzériBasqueBengaliBiélorusse >> BirmanBosniaqueBulgareCatalanCebuanoChichewaChinois (Simp)Chinois (Trad) >> CingalaiCoréenCréole haïtienCroateDanoisEspagnolEspérantoEstonienFinnois >> FrançaisGalicienGalloisGéorgienGoudjaratiGrecHaoussaHébreuHindiHmongH >> ongroisIgboIndonésienIrlandaisIslandaisItalienJaponaisJavanaisKannada >> KazakhKhmerLaotienLatinLettonLituanienMacédonienMalaisienMalayalam >> MalgacheMaltaisMaoriMarathiMongolNéerlandaisNépalaisNorvégienOuzbek >> PanjabiPersanPolonaisPortugaisRoumainRusseSerbeSesothoSlovaqueSlovène >> SomaliSoudanaisSuédoisSwahiliTadjikTagalogTamoulTchèqueTeluguThaïTurc >> UkrainienUrduVietnamienYiddishYoroubaZoulou >> Fonction Sound est limitée à 200 caractères >> Options : Historique : Commentaires : Donate >> <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GD9D8CPW8HFA2> >> Fermer >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Jonathan Yu / *@jawnsy* on LinkedIn <https://linkedin.com/in/jawnsy>, > Twitter <https://twitter.com/jawnsy>, GitHub <https://github.com/jawnsy>, > Facebook <https://facebook.com/jawnsy> > *“Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.”* — > Samuel Beckett, Worstward Ho (1983) > > “In an adaptive environment, winning comes from adapting to change by > continuously experimenting and identifying new options more quickly and > economically than others. The classical strategist's mantra of sustainable > competitive advantage becomes one of serial temporary advantage.” — Navigating > the Dozens of Different Strategy Options > <https://hbr.org/2015/06/navigating-the-dozens-of-different-strategy-options> > (HBR) > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.