<< 28-10-2025 >>

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:44FromDiscord<nevillegg> is nim really good?
09:25:51FromDiscord<janakali> In reply to @nevillegg "is nim really good?": good for what?
09:25:54FromDiscord<janakali> also, yes it's good
09:26:04FromDiscord<janakali> for most things
09:30:08FromDiscord<systemblue2010> sent a long message, see https://pasty.ee/PgLnDBAP
09:30:11FromDiscord<systemblue2010> Nim is wonderful language
09:30:13FromDiscord<systemblue2010> try ti
09:30:18FromDiscord<systemblue2010> (edit) "ti" => "it"
09:30:35FromDiscord<systemblue2010> if there's something you don't know or hard to learn, then send me DM
09:30:38FromDiscord<systemblue2010> I will help you
09:37:35*beholders_eye joined #nim
10:21:32*vsantana joined #nim
11:43:21FromDiscord<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:18FromDiscord<ieltan> In reply to @ayex "dom modification from js": Does wasm even support DOM access?
11:57:32FromDiscord<ieltan> I don't think it directly does, what is Nim supposed to do
11:57:37FromDiscord<ieltan> (edit) "do" => "do?"
11:59:12FromDiscord<ayex> that is what I thought as well 🤔
11:59:47FromDiscord<ayex> that is what I thought as well 🤔↵↵but of course would be nice to have..
12:16:53FromDiscord<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:46Amun-Rayes, 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:16FromDiscord<systemblue2010> In reply to @ieltan "Does wasm even support": no Nim does
16:29:25FromDiscord<systemblue2010> WASM doesn't but Nim does
16:30:44FromDiscord<ieltan> the Nim js backend does, they were talking about the technically-non-existent wasm backend
16:32:49FromDiscord<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:28Amun-Raor use emscripten directly
16:58:16*krunsh joined #nim
17:32:08*krunsh quit (Quit: WeeChat 4.7.1)
17:50:35FromDiscord<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:46FromDiscord<planetis_m> Anyone on ubuntu can try the nimony package? https://launchpad.net/~planetis/+archive/ubuntu/nim
19:19:41FromDiscord<planetis_m> nvm it failed
20:21:52*Alfom joined #nim
20:23:11AlfomHi 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:12AlfomThanks for your help!
20:39:09FromDiscord<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:53FromDiscord<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:20Alfomthanks, I need to update individual rows
20:53:13Alfomlike filter out one specific row and update one value on that row
20:53:51FromDiscord<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:38Alfomyes
21:32:32*rockcavera joined #nim
21:32:46FromDiscord<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:57FromDiscord<nervecenter> That's youre `[]=` overload, but it's not recommended
21:33:48FromDiscord<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:54FromDiscord<nervecenter> So use `[]=` with caution.
21:34:00FromDiscord<nervecenter> (edit) "youre" => "your"
21:34:08FromDiscord<nervecenter> (edit) "recommended" => "recommended."
21:35:08FromDiscord<nervecenter> (edit) "that have" => "where you apply" | removed "applied"
21:36:10FromDiscord<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:05Alfomthanks!
21:37:19Alfomyou would recommand using sqlite instead for example?
21:37:33Alfomin memory, in my use case
21:38:36FromDiscord<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:02FromDiscord<nervecenter> Once I've done my modifications, I'll make a new dataframe using `toDF` afterwards
21:39:20FromDiscord<nervecenter> (edit) "object-of-`seq`s" => "object-of-`seq`s."
21:40:04FromDiscord<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:09FromDiscord<nervecenter> (edit) "So basically, any ... data" added "individual"
21:40:09AlfomI need to parse a custom file format with pieces of indo scattered at different places and match them up
21:40:23FromDiscord<nervecenter> "indo"?
21:41:07AlfomI'm sorry, what is "indo" ?
21:41:19FromDiscord<nervecenter> I'm asking you
21:41:20Alfominfo
21:41:23Alfommy bad
21:41:39Alfompieces of info
21:42:40FromDiscord<nervecenter> Is this scattered info "sub-frames" of the same types, but different lengths? Or individual "rows" scattered all about?
21:43:04Alfomsame file but different lines
21:43:04FromDiscord<nervecenter> (edit) "Is this scattered info "sub-frames" ... of" added "or "slices""
21:43:28Alfomand the key to match them together spans 2 columns
21:44:14Alfoma blank line in the file makes the type of data change between the series of lines
21:44:23FromDiscord<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:54Alfoma group by
21:45:32FromDiscord<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:11FromDiscord<nervecenter> Dataframes are made for doing things after have all your source data
21:46:32Alfomgroup by can only be done after the gathering
21:47:06FromDiscord<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:13AlfomI thought of making an object with seqs in it at first but I am not comfortable enough with the data structures yet
21:47:39Alfomyes but I need an efficient index to do the matching
21:47:49Alfomlike a multi-key hash table
21:48:16Alfomand I could not think of a way to do it from what i grasped of the documentation
21:48:28Alfomhence the idea of using dataframes
21:48:45Alfomsince they embed indices
21:49:00FromDiscord<nervecenter> Yeah you probably want an actual in-memory database, dataframe characteristics aren't built for growing or efficient indexing
21:49:37FromDiscord<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:33Alfomthey are akin to hash tables aren't they, so quite efficient?
21:50:36FromDiscord<nervecenter> Dataframes are strongly built for column oriented ops
21:51:09AlfomI had that in mind but the amount of data is not that big
21:51:25Alfomso the performance penalty could be bearable
21:52:00FromDiscord<nervecenter> But the API is not going to help you very much there
21:52:20FromDiscord<nervecenter> If you can slurp all your data up, then make a DF, then perform your `groupBy`, you'd be fine
21:52:20AlfomI'm trying to find the right balance between legibility and efficiency
21:52:52Alfomyes the group by is very efficient it seems
21:53:16Alfomit is the matching of the different pieces before hand which is not
21:53:45Alfommaybe I could use a join though
21:54:07FromDiscord<nervecenter> If you want to vertically stack multiple dataframes with matching column types, there's `assignStack`
21:54:19FromDiscord<nervecenter> https://scinim.github.io/Datamancer/dataframe.html#assignStack%2Cseq%5BDataFrame%5D
21:54:21Alfomit'd be horizontal
21:54:43FromDiscord<nervecenter> I'm remembering having tried that at one point....
21:54:58FromDiscord<nervecenter> Can't remember if the attempt failed
21:55:19FromDiscord<nervecenter> btw `assignStack` absolutely breaks down if you're using `-d:danger`
21:55:29FromDiscord<nervecenter> so be aware
21:56:32Alfomthanks but what I need is more like a "join"
21:56:55Alfomwhich brings us back to RDBMS's
21:57:14FromDiscord<nervecenter> yeah, something like an in-memory db
21:57:20FromDiscord<nervecenter> or tables
21:57:21FromDiscord<vindaar> In reply to @nervecenter "btw `assignStack` absolutely breaks": huh, it should still work. never had any issues with it
21:58:10AlfomI started up with 6 different tables, with a synthetic key
21:58:20FromDiscord<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:30FromDiscord<nervecenter> I should probably research it for you
21:58:32Alfombut then I am kind of stuk when I want to compute the group by
21:59:28Alfomsynthetic key  = the two "key" variable put into a single string
21:59:34Alfomvariables
22:00:05Alfom*stuck
22:00:10Alfomsorry for the typos
22:00:31FromDiscord<nervecenter> You can do that with Datamancer if you're computing the new column from existing columns
22:00:50FromDiscord<nervecenter> But horizontal concatenation...I think you can do that but they have to be the same length
22:01:23Alfomyes but I only did it so that I could match up values belong to the same key easily
22:01:32Alfom*belonging
22:01:46Alfomwhich works fine with tables
22:03:00AlfomI have another table which I use to do lookups and it works fine
22:03:04FromDiscord<vindaar> sent a long message, see https://pasty.ee/HYAZsrGV
22:04:06FromDiscord<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:16FromDiscord<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:58FromDiscord<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:42Alfom@vindaar thanks, will do
22:10:00Alfomthe file to parse is like :
22:10:01Alfomlocation date mean_temperature for a whole month
22:10:01Alfomthen a blank line
22:10:02Alfomlocation date min_temperature for the whole month
22:10:02Alfoma blanck line
22:10:03Alfomlocation date max_temperature for the whole month
22:10:21AlfomI must gather all three temperatures for each location and date
22:10:40Alfomeach in its own column
22:11:28Alfomand then calculate an average for each date
22:11:47Alfomacross all locations
22:12:32FromDiscord<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:37FromDiscord<nervecenter> (edit) "Tensors." => "`Tensor`s."
22:12:52FromDiscord<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:52AlfomI thought of that but didn't feel comfortable not matching from the keys themselves (that is, location and date)
22:13:58FromDiscord<nervecenter> If you want for each date, the `df.filter(fn {`date` == date}) -> df["mean_temperature"].mean()`
22:14:06FromDiscord<nervecenter> (edit) "date}) -> df["mean_temperature"].mean()`" => "date})["mean_temperature"].mean()`"
22:14:16FromDiscord<nervecenter> (edit) "date})["mean_temperature"].mean()`" => "date })["mean_temperature"].mean()`"
22:14:25FromDiscord<nervecenter> (edit) "{`date`" => "{\`date\`"
22:14:34Alfomthe computation of the average I have it already working
22:14:36FromDiscord<nervecenter> (edit) "{\`date\`" => "{`date`"
22:14:40tokyovigilanteis there a good reference for array/sequence shorthand, eg doc for what ^1 means in seq[^1]
22:14:57Alfom@[] ?
22:15:20AlfomI guess the nim tutorial is a good starting point?
22:15:35FromDiscord<nervecenter> In reply to @tokyovigilante "is there a good": https://nim-lang.org/docs/tut1.html#advanced-types-slices
22:15:59Alfomhttps://nim-lang.org/docs/tut1.html#advanced-types-sequences
22:17:23FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=FItlhlSc
22:17:23AlfomI 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:53FromDiscord<nervecenter> Unfortunately parsing data from a file is never going to be understandable to non-programmers very easily
22:18:11FromDiscord<nervecenter> Comment it well and move on
22:18:28Alfomyou are right
22:19:20tokyovigilantenervcenter: thanks!
22:19:58FromDiscord<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:00Alfomhave you guys ever tried to put together a multi-dimensional "table", e.g. as in Python dict["location"][date] ?
22:20:17Alfomit does fit it for the agregation part
22:20:28Alfomwhich actually works for the first columns
22:20:47AlfomDatamancer I mean
22:21:14FromDiscord<nervecenter> You probably want to filter by location into a new smaller df, then filter by date to another smaller df
22:22:00Alfomfor the calculations everything works well as it is
22:22:04FromDiscord<nervecenter> Anyways I have to go. Remember Datamancer is built for map-filter-reduce composition
22:22:09Alfomit is just to put everyting together
22:22:23Alfomgot it, thanks a lot for your time!
22:22:32Alfomvery appreciated