Front page | perl.perl6.users |
Postings from July 2021
[naive] hash assingment
Thread Next
From:
Aureliano Guedes
Date:
July 14, 2021 17:43
Subject:
[naive] hash assingment
Message ID:
CAG9gabQ79W24vWKNe7t8qcLkaHyiCMbAySRqsmp2rhGK_yRzaQ@mail.gmail.com
Hi all,
Trying to knowing a little bit more about Raku lang, I decided to write a
simple (as possible) lib to became similar to R/dplyr or Python/Pandas
method to data wrangle.
So, Raku gives us the possibility to deal with data in a functional way,
given the native pipe operator, which is wonderful for newbies.
> @a = 1..100
> @a ==> map( { .sqrt } )
> @a ==> HYPER( { .sqrt } ) # faster map
Even it is being *too verbose*, is good enough for the first moment to a
data scientist.
So I'm trying to decide the best way to abstract columns.
First, I decide to use a hash where the key is the column name and the
value is the oriented list ou array.
> my %a = {'column1' => [1...5], 'column2' => ['a'...'e']}
Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you
mean := instead?
at line 2
------> <BOL>⏏<EOL>
{column1 => [1 2 3 4 5], column2 => [a b c d e]}
It is a warning, not an error!
But let's obey the warning.
> my %a = {'column1' := [1...5], 'column2' := ['a'...'e']}
===SORRY!=== Error while compiling:
Cannot use bind operator with this left-hand side
------> n1' := [1...5], 'column2' := ['a'...'e']⏏}
Now we got an error.
Someone may explain me why I got this error??
Thanks in advance
--
Aureliano Guedes
skype: aureliano.guedes
contato: (11) 94292-6110
whatsapp +5511942926110
Thread Next
-
[naive] hash assingment
by Aureliano Guedes