Honestly I would advise against using ==> at the moment.
For one thing it doesn't even work like it is intended.
Each side of it is supposed to act like a separate process.
There are also issues with the syntax that are LTA.
The fact that you have to tell it the left side is actually a list is on
On Wed, Jul 14, 2021 at 07:41:14PM +, Daniel Sockwell wrote:
> (Also, you may already know this, but when the keys of your hash are
> strings, you can write %a instead of %a{'column1'} )
A minor nit: this only works if the string keys don't contain whitespace.
(The single angle bracket postf
Hi Aureliano!
Backing up a bit (and since you're favoring an array data structure), we
had a discussion on StackOverflow regarding implementing R's concept of
"named vectors" in Raku. See:
"Is there a convenient way to replicate R's concept of 'named vectors' in
Raku, possibly using Mixins?"
http
thank
It is now more clear.
And I like this notation |%a ==> map({.sqrt});
less is more sometimes
On Wed, Jul 14, 2021 at 4:41 PM Daniel Sockwell
wrote:
> To expand slightly on what Clifton said, the reason that
>
> > %a = %a.map: { .sqrt };
> > # (1 1.4142135623730951 1.7320508075688772 2 2.
To expand slightly on what Clifton said, the reason that
> %a = %a.map: { .sqrt };
> # (1 1.4142135623730951 1.7320508075688772 2 2.23606797749979)
does what you mean but
> %a{'column1'} ==> map( { .sqrt } )
> # (2.23606797749979)
does not is that the method .map maps over *each item* in the A
Yes, it does help.
So, to create a new pair *k*ey/*v*alue on the fly in a hash given another
pair k/v, or even modify it will be a problem, then maybe will better
use an array instead of a hash.
> my @a = [ 1..5, 'a'..'e' ]
[1..5 "a".."e"]
> @a[2] = [@a[0][] ==> map( { .sqrt} )]
> @a[2]
[1 1.4142
Unfortunately, given this:
my %a = 'column1' => [1...5], 'column2' => ['a'...'e']
>
column1 and column2 cannot yet be referenced to create column3.
You need to do that on another line:
%a = %a.map: { .sqrt };
Which gives the following:
> %a.gist.say
# {column1 => [1 2 3 4 5], column2 => [a b
Thanks JJ, Marcel, Matthew
That's help me a lot to understand how Raku hashes work;
Little bit complex compared to Perl5.
But now I got another question
given
my %a = 'column1' => [1...5], 'column2' => ['a'...'e']
I want to calculate sqrt and store in column3
> %a{'column1'}.map({ .sqrt })
(1 1
On 7/14/21 7:43 PM, Aureliano Guedes wrote:
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 wa
El mié, 14 jul 2021 a las 19:43, Aureliano Guedes (<
guedes.aureli...@gmail.com>) escribió:
> 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
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 wonder
Hi, I've recently updated my Rakudo installation, and I wanted to test
multi-line input in the REPL. By mistake I entered a backslash at the REPL
command line:
user@mbook:$ raku
Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2021.06.
Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d.
Built on MoarVM version 2021.06.
To exit
12 matches
Mail list logo