| 01:44:09 | * | rockcavera quit (Remote host closed the connection) |
| 02:31:22 | * | beholders_eye quit (Ping timeout: 246 seconds) |
| 05:23:43 | * | zero` quit (Ping timeout: 240 seconds) |
| 07:15:56 | * | zero` joined #nim |
| 07:24:11 | * | zero` quit (Quit: zero`) |
| 07:27:49 | * | zero` joined #nim |
| 07:45:32 | * | zero` quit (Quit: zero`) |
| 08:10:55 | * | meinside joined #nim |
| 08:24:23 | * | zero` joined #nim |
| 08:44:44 | FromDiscord | <nevillegg> is nim really good? |
| 09:25:51 | FromDiscord | <janakali> In reply to @nevillegg "is nim really good?": good for what? |
| 09:25:54 | FromDiscord | <janakali> also, yes it's good |
| 09:26:04 | FromDiscord | <janakali> for most things |
| 09:30:08 | FromDiscord | <systemblue2010> sent a long message, see https://pasty.ee/PgLnDBAP |
| 09:30:11 | FromDiscord | <systemblue2010> Nim is wonderful language |
| 09:30:13 | FromDiscord | <systemblue2010> try ti |
| 09:30:18 | FromDiscord | <systemblue2010> (edit) "ti" => "it" |
| 09:30:35 | FromDiscord | <systemblue2010> if there's something you don't know or hard to learn, then send me DM |
| 09:30:38 | FromDiscord | <systemblue2010> I will help you |
| 09:37:35 | * | beholders_eye joined #nim |
| 10:21:32 | * | vsantana joined #nim |
| 11:43:21 | FromDiscord | <ayex> dom modification from js target is clear, but also from wasm?↵↵I haven't seen that one yet (without shims) for nim - is there somewhere an example of this? |
| 11:57:18 | FromDiscord | <ieltan> In reply to @ayex "dom modification from js": Does wasm even support DOM access? |
| 11:57:32 | FromDiscord | <ieltan> I don't think it directly does, what is Nim supposed to do |
| 11:57:37 | FromDiscord | <ieltan> (edit) "do" => "do?" |
| 11:59:12 | FromDiscord | <ayex> that is what I thought as well 🤔 |
| 11:59:47 | FromDiscord | <ayex> that is what I thought as well 🤔↵↵but of course would be nice to have.. |
| 12:16:53 | FromDiscord | <ieltan> In reply to @ayex "that is what I": it's a wasm limitation afaik there legit nothing you can do in nim except call js glue code to do it lol |
| 12:17:07 | * | beholders_eye quit (Ping timeout: 264 seconds) |
| 12:27:46 | Amun-Ra | yes, glue code is required |
| 13:12:10 | * | beholders_eye joined #nim |
| 13:55:34 | * | beholders_eye quit (Ping timeout: 256 seconds) |
| 13:57:23 | * | beholders_eye joined #nim |
| 16:07:21 | * | przmk quit (Remote host closed the connection) |
| 16:07:55 | * | przmk joined #nim |
| 16:29:16 | FromDiscord | <systemblue2010> In reply to @ieltan "Does wasm even support": no Nim does |
| 16:29:25 | FromDiscord | <systemblue2010> WASM doesn't but Nim does |
| 16:30:44 | FromDiscord | <ieltan> the Nim js backend does, they were talking about the technically-non-existent wasm backend |
| 16:32:49 | FromDiscord | <ieltan> so the method intuitively should be to compile nim with the c as usual and convert the c generated code to wasm, that wasm generated code call js glue code to manipulate dom because wasm itself cannot |
| 16:33:28 | Amun-Ra | or use emscripten directly |
| 16:58:16 | * | krunsh joined #nim |
| 17:32:08 | * | krunsh quit (Quit: WeeChat 4.7.1) |
| 17:50:35 | FromDiscord | <rakgew> also nlvm is a currently available avenue for wasm |
| 18:05:33 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
| 18:08:34 | * | Lord_Nightmare joined #nim |
| 19:18:46 | FromDiscord | <planetis_m> Anyone on ubuntu can try the nimony package? https://launchpad.net/~planetis/+archive/ubuntu/nim |
| 19:19:41 | FromDiscord | <planetis_m> nvm it failed |
| 20:21:52 | * | Alfom joined #nim |
| 20:23:11 | Alfom | Hi all, new to nim, I'm looking for a way to update rows of a datamancer dataframe. Is there a simple way to achieve this? |
| 20:23:12 | Alfom | Thanks for your help! |
| 20:39:09 | FromDiscord | <vindaar> when you say "update rows" what kind of API do you have in mind? Update a few individual rows in full (i.e. all columns at the same time)? |
| 20:48:53 | FromDiscord | <vindaar> anyway, if you really need to mutate full columns, you can write your own function that uses https://scinim.github.io/Datamancer/dataframe.html#%5B%5D%3D%2CDataFrame%2Cstring%2Cint%2CT or https://scinim.github.io/Datamancer/dataframe.html#%5B%5D%2CDataFrame%2Cstring with https://scinim.github.io/Datamancer/column.html#%5B%5D%3D%2CColumn%2Cint%2CT (the latter would be safer) |
| 20:52:20 | Alfom | thanks, I need to update individual rows |
| 20:53:13 | Alfom | like filter out one specific row and update one value on that row |
| 20:53:51 | FromDiscord | <vindaar> so you only need to update a single column in one row? |
| 20:59:07 | * | vsantana quit (Ping timeout: 264 seconds) |
| 21:02:50 | * | Alfom72 joined #nim |
| 21:03:28 | * | Alfom72 quit (Client Quit) |
| 21:25:38 | Alfom | yes |
| 21:32:32 | * | rockcavera joined #nim |
| 21:32:46 | FromDiscord | <nervecenter> In reply to @Alfom "Hi all, new to": https://scinim.github.io/Datamancer/dataframe.html#%5B%5D%3D%2CDataFrame%2Cstring%2Cint%2CT |
| 21:32:57 | FromDiscord | <nervecenter> That's youre `[]=` overload, but it's not recommended |
| 21:33:48 | FromDiscord | <nervecenter> Dataframes aren't really meant to function as random-access databases, more as "frames of data" (who'd have guessed) that have compositions of map-reduce style computations applied to produce new columns or aggregates. |
| 21:33:54 | FromDiscord | <nervecenter> So use `[]=` with caution. |
| 21:34:00 | FromDiscord | <nervecenter> (edit) "youre" => "your" |
| 21:34:08 | FromDiscord | <nervecenter> (edit) "recommended" => "recommended." |
| 21:35:08 | FromDiscord | <nervecenter> (edit) "that have" => "where you apply" | removed "applied" |
| 21:36:10 | FromDiscord | <nervecenter> For example, unlike true databases, adding rows to dataframes is extremely expensive due to copy costs given pre-allocation strategies. So again, not great as random-access databases. |
| 21:37:05 | Alfom | thanks! |
| 21:37:19 | Alfom | you would recommand using sqlite instead for example? |
| 21:37:33 | Alfom | in memory, in my use case |
| 21:38:36 | FromDiscord | <nervecenter> I don't do many individual row modifications in my codebase, more composite computations like I said. Typically, if I'm modifying individual values, I'm doing it on individual `seq`s or object-of-`seq`s |
| 21:39:02 | FromDiscord | <nervecenter> Once I've done my modifications, I'll make a new dataframe using `toDF` afterwards |
| 21:39:20 | FromDiscord | <nervecenter> (edit) "object-of-`seq`s" => "object-of-`seq`s." |
| 21:40:04 | FromDiscord | <nervecenter> So basically, any data that needs to be modified, I'll use native data. Once I have something I can do higher-level operations on, I move to dataframes. |
| 21:40:09 | FromDiscord | <nervecenter> (edit) "So basically, any ... data" added "individual" |
| 21:40:09 | Alfom | I need to parse a custom file format with pieces of indo scattered at different places and match them up |
| 21:40:23 | FromDiscord | <nervecenter> "indo"? |
| 21:41:07 | Alfom | I'm sorry, what is "indo" ? |
| 21:41:19 | FromDiscord | <nervecenter> I'm asking you |
| 21:41:20 | Alfom | info |
| 21:41:23 | Alfom | my bad |
| 21:41:39 | Alfom | pieces of info |
| 21:42:40 | FromDiscord | <nervecenter> Is this scattered info "sub-frames" of the same types, but different lengths? Or individual "rows" scattered all about? |
| 21:43:04 | Alfom | same file but different lines |
| 21:43:04 | FromDiscord | <nervecenter> (edit) "Is this scattered info "sub-frames" ... of" added "or "slices"" |
| 21:43:28 | Alfom | and the key to match them together spans 2 columns |
| 21:44:14 | Alfom | a blank line in the file makes the type of data change between the series of lines |
| 21:44:23 | FromDiscord | <nervecenter> Okay, important question: Are you compiling all this data together before performing any composite computations that would match up to `mutate` or `filter` or `select`? |
| 21:44:54 | Alfom | a group by |
| 21:45:32 | FromDiscord | <nervecenter> What I mean is, are you gathering the data before you do anything with it? Or doing things with it while you gather it? |
| 21:46:11 | FromDiscord | <nervecenter> Dataframes are made for doing things after have all your source data |
| 21:46:32 | Alfom | group by can only be done after the gathering |
| 21:47:06 | FromDiscord | <nervecenter> Then slurp all your data up into `seq`s that are the type of each column, and when you're done parsing it all, turn it into a dataframe with `toDf` |
| 21:47:13 | Alfom | I thought of making an object with seqs in it at first but I am not comfortable enough with the data structures yet |
| 21:47:39 | Alfom | yes but I need an efficient index to do the matching |
| 21:47:49 | Alfom | like a multi-key hash table |
| 21:48:16 | Alfom | and I could not think of a way to do it from what i grasped of the documentation |
| 21:48:28 | Alfom | hence the idea of using dataframes |
| 21:48:45 | Alfom | since they embed indices |
| 21:49:00 | FromDiscord | <nervecenter> Yeah you probably want an actual in-memory database, dataframe characteristics aren't built for growing or efficient indexing |
| 21:49:37 | FromDiscord | <nervecenter> As it is, when you index a row, it's peeking into multiple allocated arraymancer `Tensor`s to get each element and wrap them in a `Value` |
| 21:50:33 | Alfom | they are akin to hash tables aren't they, so quite efficient? |
| 21:50:36 | FromDiscord | <nervecenter> Dataframes are strongly built for column oriented ops |
| 21:51:09 | Alfom | I had that in mind but the amount of data is not that big |
| 21:51:25 | Alfom | so the performance penalty could be bearable |
| 21:52:00 | FromDiscord | <nervecenter> But the API is not going to help you very much there |
| 21:52:20 | FromDiscord | <nervecenter> If you can slurp all your data up, then make a DF, then perform your `groupBy`, you'd be fine |
| 21:52:20 | Alfom | I'm trying to find the right balance between legibility and efficiency |
| 21:52:52 | Alfom | yes the group by is very efficient it seems |
| 21:53:16 | Alfom | it is the matching of the different pieces before hand which is not |
| 21:53:45 | Alfom | maybe I could use a join though |
| 21:54:07 | FromDiscord | <nervecenter> If you want to vertically stack multiple dataframes with matching column types, there's `assignStack` |
| 21:54:19 | FromDiscord | <nervecenter> https://scinim.github.io/Datamancer/dataframe.html#assignStack%2Cseq%5BDataFrame%5D |
| 21:54:21 | Alfom | it'd be horizontal |
| 21:54:43 | FromDiscord | <nervecenter> I'm remembering having tried that at one point.... |
| 21:54:58 | FromDiscord | <nervecenter> Can't remember if the attempt failed |
| 21:55:19 | FromDiscord | <nervecenter> btw `assignStack` absolutely breaks down if you're using `-d:danger` |
| 21:55:29 | FromDiscord | <nervecenter> so be aware |
| 21:56:32 | Alfom | thanks but what I need is more like a "join" |
| 21:56:55 | Alfom | which brings us back to RDBMS's |
| 21:57:14 | FromDiscord | <nervecenter> yeah, something like an in-memory db |
| 21:57:20 | FromDiscord | <nervecenter> or tables |
| 21:57:21 | FromDiscord | <vindaar> In reply to @nervecenter "btw `assignStack` absolutely breaks": huh, it should still work. never had any issues with it |
| 21:58:10 | Alfom | I started up with 6 different tables, with a synthetic key |
| 21:58:20 | FromDiscord | <nervecenter> In reply to @vindaar "huh, it should still": Actually I don't think it was `assignStack`, I was seeing my numbers fly far, wide, and randomly in some other computations when using `-d:danger` |
| 21:58:30 | FromDiscord | <nervecenter> I should probably research it for you |
| 21:58:32 | Alfom | but then I am kind of stuk when I want to compute the group by |
| 21:59:28 | Alfom | synthetic key = the two "key" variable put into a single string |
| 21:59:34 | Alfom | variables |
| 22:00:05 | Alfom | *stuck |
| 22:00:10 | Alfom | sorry for the typos |
| 22:00:31 | FromDiscord | <nervecenter> You can do that with Datamancer if you're computing the new column from existing columns |
| 22:00:50 | FromDiscord | <nervecenter> But horizontal concatenation...I think you can do that but they have to be the same length |
| 22:01:23 | Alfom | yes but I only did it so that I could match up values belong to the same key easily |
| 22:01:32 | Alfom | *belonging |
| 22:01:46 | Alfom | which works fine with tables |
| 22:03:00 | Alfom | I have another table which I use to do lookups and it works fine |
| 22:03:04 | FromDiscord | <vindaar> sent a long message, see https://pasty.ee/HYAZsrGV |
| 22:04:06 | FromDiscord | <nervecenter> In reply to @Alfom "yes but I only": Maybe the formula docs can help, there are a few special symbols you can use in formulas to access indices and column names↵https://scinim.github.io/Datamancer/formula.html#%7B%7D.m%2C%2Cuntyped |
| 22:04:16 | FromDiscord | <vindaar> In reply to @nervecenter "But horizontal concatenation...I think": technically you could concat horizontally and have the shorter DF be converted to object columns and then extended. But that's unlikely to be the thing you want (unless you work with really ugly data already that has missing entries etc) |
| 22:05:54 | * | rockcavera is now known as Guest7518 |
| 22:05:54 | * | tiorock joined #nim |
| 22:05:54 | * | Guest7518 quit (Killed (silver.libera.chat (Nickname regained by services))) |
| 22:05:54 | * | tiorock is now known as rockcavera |
| 22:05:58 | FromDiscord | <vindaar> @Alfom if you can write up an example snippet with some data to showcase what you are trying to do, I can maybe give some advice. At the moment I can't quite follow you though. And now I need to head to bed 🙂 |
| 22:07:42 | Alfom | @vindaar thanks, will do |
| 22:10:00 | Alfom | the file to parse is like : |
| 22:10:01 | Alfom | location date mean_temperature for a whole month |
| 22:10:01 | Alfom | then a blank line |
| 22:10:02 | Alfom | location date min_temperature for the whole month |
| 22:10:02 | Alfom | a blanck line |
| 22:10:03 | Alfom | location date max_temperature for the whole month |
| 22:10:21 | Alfom | I must gather all three temperatures for each location and date |
| 22:10:40 | Alfom | each in its own column |
| 22:11:28 | Alfom | and then calculate an average for each date |
| 22:11:47 | Alfom | across all locations |
| 22:12:32 | FromDiscord | <nervecenter> That's simple, three for loops, each accumulating to it's own `seq`, then `toDf`. Then you can use formulas or simple `mean` calls on the column Tensors. |
| 22:12:37 | FromDiscord | <nervecenter> (edit) "Tensors." => "`Tensor`s." |
| 22:12:52 | FromDiscord | <nervecenter> (edit) "That's simple, three for loops, each accumulating to it's own `seq`, then `toDf`. Then you can use formulas ... or" added "to compute the mean" |
| 22:13:52 | Alfom | I thought of that but didn't feel comfortable not matching from the keys themselves (that is, location and date) |
| 22:13:58 | FromDiscord | <nervecenter> If you want for each date, the `df.filter(fn {`date` == date}) -> df["mean_temperature"].mean()` |
| 22:14:06 | FromDiscord | <nervecenter> (edit) "date}) -> df["mean_temperature"].mean()`" => "date})["mean_temperature"].mean()`" |
| 22:14:16 | FromDiscord | <nervecenter> (edit) "date})["mean_temperature"].mean()`" => "date })["mean_temperature"].mean()`" |
| 22:14:25 | FromDiscord | <nervecenter> (edit) "{`date`" => "{\`date\`" |
| 22:14:34 | Alfom | the computation of the average I have it already working |
| 22:14:36 | FromDiscord | <nervecenter> (edit) "{\`date\`" => "{`date`" |
| 22:14:40 | tokyovigilante | is there a good reference for array/sequence shorthand, eg doc for what ^1 means in seq[^1] |
| 22:14:57 | Alfom | @[] ? |
| 22:15:20 | Alfom | I guess the nim tutorial is a good starting point? |
| 22:15:35 | FromDiscord | <nervecenter> In reply to @tokyovigilante "is there a good": https://nim-lang.org/docs/tut1.html#advanced-types-slices |
| 22:15:59 | Alfom | https://nim-lang.org/docs/tut1.html#advanced-types-sequences |
| 22:17:23 | FromDiscord | <nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=FItlhlSc |
| 22:17:23 | Alfom | I did not go the "seq" route from the start because people less tech-savy than me might have to understand the code and maintain it later on |
| 22:17:53 | FromDiscord | <nervecenter> Unfortunately parsing data from a file is never going to be understandable to non-programmers very easily |
| 22:18:11 | FromDiscord | <nervecenter> Comment it well and move on |
| 22:18:28 | Alfom | you are right |
| 22:19:20 | tokyovigilante | nervcenter: thanks! |
| 22:19:58 | FromDiscord | <nervecenter> But it seems like your use case does in fact fit Datamancer dataframes pretty well. Don't overthink it, and read through the API docs. |
| 22:20:00 | Alfom | have you guys ever tried to put together a multi-dimensional "table", e.g. as in Python dict["location"][date] ? |
| 22:20:17 | Alfom | it does fit it for the agregation part |
| 22:20:28 | Alfom | which actually works for the first columns |
| 22:20:47 | Alfom | Datamancer I mean |
| 22:21:14 | FromDiscord | <nervecenter> You probably want to filter by location into a new smaller df, then filter by date to another smaller df |
| 22:22:00 | Alfom | for the calculations everything works well as it is |
| 22:22:04 | FromDiscord | <nervecenter> Anyways I have to go. Remember Datamancer is built for map-filter-reduce composition |
| 22:22:09 | Alfom | it is just to put everyting together |
| 22:22:23 | Alfom | got it, thanks a lot for your time! |
| 22:22:32 | Alfom | very appreciated |