Re: [Jprogramming] Get all indexes of a boolean array

2023-12-11 Thread Pablo Landherr
index =: $ #: [: I. , index ? 2 4$2 0 0 1 0 1 3 index ? 2 4 5$2 0 0 0 0 0 1 0 0 2 0 0 3 0 1 1 0 2 1 0 2 3 0 2 4 0 3 2 1 0 0 1 0 1 1 0 2 1 0 4 1 1 1 1 1 3 1 2 1 1 2 2 1 2 4 1 3 0 1 3 1 1 3 2 On Mon, Dec 11, 2023 at 11:06 AM LdBeth wrote: > I've been running to too many

Re: [Jprogramming] Extracting content from nested data

2023-09-29 Thread Pablo Landherr
)&{::@> data > > untested. > > Henry Rich > > On 9/29/2023 9:39 AM, Pablo Landherr wrote: > > I have the following > > > > *data=: dec_json {some d

[Jprogramming] Extracting content from nested data

2023-09-29 Thread Pablo Landherr
der if someone can suggest a more "elegant" expression than >>0&{&.>1&{&.> from above? What I have works, but to me, it looks a bit ugly. Thank you, Pablo Landherr -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Using rest API in J

2023-09-20 Thread Pablo Landherr
ither curl or wget under the hood. > > What you need to do is to add a header to your request. The header name > will be 'Ocp-Apim-Subscription-Key' and the value, whatever key you > received. > > If it's curl under the hood, the option to add a header is '-H >

Re: [Jprogramming] Using rest API in J

2023-09-20 Thread Pablo Landherr
der called Ocp-Apim-Subscription-Key. Given that my requests were something like this: gethttp ' https://api-test.riksbank.se/swea/v1/Observations/SEKUSDPMI/2023-01-01' how do I modify this to include the key? Thank you, Pablo On Tue, Sep 19, 2023 at 1:05 PM Pablo Landherr wro

Re: [Jprogramming] Using rest API in J

2023-09-19 Thread Pablo Landherr
ument has moved https://www.jsoftware.com/";>here. Apache/2.4.29 (Ubuntu) Server at www.jsoftware.com Port 80 On Tue, Sep 19, 2023 at 12:55 PM Pablo Landherr wrote: > Thank you. Will start there. > > On Tue, Sep 19, 2023 at 12:47 PM Ed Gottsman > wrote: > >> Pab

Re: [Jprogramming] Using rest API in J

2023-09-19 Thread Pablo Landherr
ttp > > Best of luck and feel free to ask questions. > > Ed > > > On Sep 19, 2023, at 11:42 AM, Pablo Landherr > wrote: > > > > I have searched the J wiki but am unable to find some newbie examples > > showing how to use J (client side) with rest API. I wi

[Jprogramming] Using rest API in J

2023-09-19 Thread Pablo Landherr
you, Pablo Landherr -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] x-labels using plot package

2022-12-28 Thread Pablo Landherr
ot; " May" " Jun" " Jul" " Aug" " Sep" " > Oct" " Nov" " Dec" " "' > > > https://code.jsoftware.com/wiki/Studio/Plot > > https://code.jsoftware.com/wiki/Plot > > On Wed, Dec 28, 2022

[Jprogramming] x-labels using plot package

2022-12-28 Thread Pablo Landherr
I have a time series of 365 data points corresponding to the days of the year. I'm struggling with creating useful and readable labels for the x-axis. Using the default I get them numbered 0 - 364 with labels at every 50th tick mark. This is very readable, but not so useful as it takes a while to r

Re: [Jprogramming] plot makes J hang

2022-11-30 Thread Pablo Landherr
n. Thanks. > > On Wed, Nov 30, 2022 at 6:56 PM Pablo Landherr > wrote: > > > I really do think that all the ways that the plot package makes J crash > or > > hang for the slightest mistake is a major drawback. > > > > JVERSION > > > > Engine: j903/j64a

[Jprogramming] plot makes J hang

2022-11-30 Thread Pablo Landherr
I really do think that all the ways that the plot package makes J crash or hang for the slightest mistake is a major drawback. JVERSION Engine: j903/j64avx2/darwin Release-b: commercial/2022-01-28T04:20:11 Library: 9.03.08 Qt IDE: 1.9.5/5.15.2(5.15.2) Platform: Darwin 64 Installer: J903 inst

Re: [Jprogramming] Plot package causing J to crash

2022-10-26 Thread Pablo Landherr
plot ?161#100 > > >JVERSION > > > Engine: j903/j64/darwin > > > Release-b: commercial/2022-01-28T04:11:24 > > > Library: 9.03.08 > > > Platform: Darwin 64 > > > Installer: J903 install > > > InstallPath: /users/brian/j903 &

Re: [Jprogramming] Plot package causing J to crash

2022-10-26 Thread Pablo Landherr
archives, > > detailing what versions of dependencies are present for each version. > > > > I'm not sure if this helps, > > > > -- > > Raul > > > > On Tue, Oct 25, 2022 at 5:21 PM Pablo Landherr > > > wrote: > > > > > > A

Re: [Jprogramming] Plot package causing J to crash

2022-10-25 Thread Pablo Landherr
series be ok? Kind regards, Pablo Landherr On Thu, Oct 20, 2022 at 7:50 PM Raul Miller wrote: > On Thu, Oct 20, 2022 at 11:36 AM Henry Rich wrote: > > Yes, that's what I see in Windows. The crash dialog says > > > > Exception thrown at 0x7FFE0355E2B4 (

Re: [Jprogramming] Plot package causing J to crash

2022-10-20 Thread Pablo Landherr
Here is an even simpler case 'xlabel a b c d' plot 4 5 6 On Thu, Oct 20, 2022 at 5:14 PM Pablo Landherr wrote: > Here is an example > > $Fcat,.' ' > > 161 38 > > ('xlabel ',,Fcat,.' ') plot ?161#100 > > (j terminates)

Re: [Jprogramming] Plot package causing J to crash

2022-10-20 Thread Pablo Landherr
ill fix it. > > Henry Rich > > On 10/20/2022 9:24 AM, Pablo Landherr wrote: > > Since I upgraded to 904, I've noticed that J will terminate immediately > if > > I send incorrect parameters or data to the plot function. That never > > happened before. Plot wou

Re: [Jprogramming] Plot package causing J to crash

2022-10-20 Thread Pablo Landherr
*903 On Thu, Oct 20, 2022 at 3:24 PM Pablo Landherr wrote: > Since I upgraded to 904, I've noticed that J will terminate immediately if > I send incorrect parameters or data to the plot function. That never > happened before. Plot would signal an error and I would try to understan

[Jprogramming] Plot package causing J to crash

2022-10-20 Thread Pablo Landherr
lost. What can I do to avoid this? Not making errors in the use of plot is not an option. ;-) I enclose (part of) the latest error report in case it helps. Kind regards, Pablo Landherr - Translated Report (Full Report

Re: [Jprogramming] J cheat sheet (or an alternative view for the NuVoc table)

2022-04-06 Thread Pablo Landherr
Your cheatsheet is very nice. However, in my browser I keep a tab with file:///Applications/j64-807/addons/docs/help/dictionary/vocabul.htm open always and at all times. And why it wins out over NuVoc etc is because it fits on the screen. I never have to scroll to find the relevant information. Yea

Re: [Jprogramming] Finding consecutive indices

2021-11-17 Thread Pablo Landherr
s in misc/miscutils/utils as progressiveindex, e.g. > > load'misc/miscutils/utils' > > 0 0 2 0 2 0 3 3 progressiveindex 2 2 2 3 4 > > 2 4 8 6 8 > > > > On Wed, Nov 17, 2021 at 5:33 AM Pablo Landherr > wrote: > > > I cannot figure out how to make a "si

[Jprogramming] Finding consecutive indices

2021-11-17 Thread Pablo Landherr
I cannot figure out how to make a "simple" verb that finds the indices (like i.) but gives the next index if there are multiple occurrences, like this 0 0 2 0 2 0 3 3 foo 2 2 2 3 4 2 4 8 6 8 I have a hunch a boolean matrix is involved but there I get stuck. Kr, Pablo -

Re: [Jprogramming] Odd behaviour - functional?

2021-09-14 Thread Pablo Landherr
No. I get: kk=.i.5 kk 0 1 2 3 4 kk=.>:kk kk 1 2 3 4 5 i.5 0 1 2 3 4 On Tue, Sep 14, 2021 at 3:59 PM Jon Quant wrote: > Dear all, > > I have tried the following code and get unexpected results and wanted your > seasoned advice. > >kk=.i.5 >kk > 0 1 2 3 4 >kk=.>:kk >kk > 1

Re: [Jprogramming] Connecting the connections

2021-09-06 Thread Pablo Landherr
dices=:{{ > > NB. x: ORPnoid > > NB. y: ORPioid > > assert. 1=>./x#/.y > > valid=. y e. x > > cns=. (1+x i.valid#y) (1+I.valid)} i.1+#x NB. connections > > ( > }} > > > > I hope this helps, > > > > -- > > Raul > > >

Re: [Jprogramming] Connecting the connections

2021-09-06 Thread Pablo Landherr
(and ORPioid). > > So, for example, you should be able to do: > > ndx=: ORPnoid cnGroupIndices ORPioid > > And then, for example, you could do this: >ndx {each ORPnoid > > I hope that that makes sense. (And, I hope that I did not make a silly > mistake here.) > > Th

Re: [Jprogramming] Connecting the connections

2021-09-06 Thread Pablo Landherr
either > >>./ NID #/.OID > > or > >>/. OID #/. NID > > then you can represent the connection matrix with a connection list, > which would be about the same size as your OID or NID list. > > I hope this makes sense, > > -- > Raul > > On Mon, Sep 6

Re: [Jprogramming] Connecting the connections

2021-09-06 Thread Pablo Landherr
> > 0 0 0 0 0 1 1 0 0 0 0 1 > > > 0 0 0 0 0 0 0 1 1 1 1 0 > > > 0 0 0 0 0 0 0 1 1 1 1 0 > > > 0 0 0 0 0 0 0 1 1 1 1 0 > > > 0 0 0 0 0 0 0 1 1 1 1 0 > > > 0 0 0 0 0 1 1 0 0 0 0 1 > > > > > > That gives us something close to the grouping you asked for: &g

[Jprogramming] Connecting the connections

2021-09-03 Thread Pablo Landherr
I want to group items that are linked to each other. I tried to use some kind of connection matrix nid =/ oid NB. an example 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Re: [Jprogramming] Is internal representation the problem? (again...)

2021-08-23 Thread Pablo Landherr
n inspect the bit pattern of 0.05 inside data vs that of real 0.05 > >a.i. 2&(3!:5) 0.5 > > 0 0 0 0 0 0 224 63 > >a.i. 2&(3!:5) {.{.countfreq data > > > > similarly check the bit pattern of the two _0.05 > > > > On Thu, Aug

Re: [Jprogramming] Is internal representation the problem? (again...)

2021-08-20 Thread Pablo Landherr
with large sets of data, a critical skill is being able > to extract representative small and inspectable sets of data when > isolating problems and/or testing and/or developing your code. This > has always been the case regardless of the language and coding > environment you're using. It

Re: [Jprogramming] Is internal representation the problem? (again...)

2021-08-20 Thread Pablo Landherr
evaluated in one go, or are you already buffering the > data, as suggested by several correspondents? If the latter is the case, > different buffers might give rise to “different” values... > > But we haven’t seen your data. Can you reproduce the apparent error on an > example th

Re: [Jprogramming] Is internal representation the problem? (again...)

2021-08-20 Thread Pablo Landherr
Just noticed I wrote *do* wrong. I meant ". Why would ". convert the same repeated character string into different (on a bit level) numbers? On Thu, Aug 19, 2021 at 7:33 PM Pablo Landherr wrote: > OK, I buy that. However, the origin of the data makes this dubious. The > dat

Re: [Jprogramming] Is internal representation the problem? (again...)

2021-08-19 Thread Pablo Landherr
OK, I buy that. However, the origin of the data makes this dubious. The data is imported as characters, so what I have is a bunch (thousands) of '0.05' converted in one go by ": Why would ": convert the same repeated character string of '0.05' into different numbers on a bit level? Kr, Pablo On T

[Jprogramming] Is internal representation the problem? (again...)

2021-08-19 Thread Pablo Landherr
7.10/5.9.8 Platform: Darwin 64 Installer: J807 install InstallPath: /applications/j64-807 Contact: www.jsoftware.com Two observations: 0) I expected +/0.05=data to yield 1161 1) _0.05 occurs twice in the first column (print precision etc are all default values) What explains this? Kind rega

Re: [Jprogramming] Rounding in format

2021-08-10 Thread Pablo Landherr
_1 _1 _1 _1 _1 _1 _1 _1 _1 _1 > _1 _1 _1 _1 _1 _1 _1 _1 _1 _1 > _1 _1 _1 _1 _1 _1 _1 _1 _1 _1 > _1 _1 _1 _1 _1 _1 _1 _1 _1 _1 > _1 _1 _1 _1 _1 _1 _1 _1 _1 _1 > > I hope this makes sense, > > -- > Raul > > > On Tue, Aug 10, 2021 at 3:34 AM Pablo Landherr > wro

[Jprogramming] Rounding in format

2021-08-10 Thread Pablo Landherr
I just came across this result: 0j1":0.05+i. 10 10 0.1 1.1 2.0 3.0 4.0 5.0 6.0 7.0 8.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 17.1 18.1 19.1 20.1 21.1 22.1 23.1 24.1 25.1 26.1 27.1 28.1 29.1 30.1 31.1 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 5

Re: [Jprogramming] [Jgeneral] interpolation (equidistant re-sampling)

2021-05-07 Thread Pablo Landherr
Here's another solution. It assumes zeroes are missing values and replaces them with interpolated values fill 3 : 0^:(*@#) b=. 1 (0 _1)} 0~:y x=. b#y n=. 2 -~/\ I. b ({:x) ,~ (n#}:x) + ; (i.&.>n) *&.> n %~ 2 -~/\ x ) fill 3 5 7 0 9 12 14 0 0 8 3 5 7 8 9 12 14 12 10 8 On Fri, May 7, 2021 a

Re: [Jprogramming] How to get actual values instead of booleans from a list?

2019-04-30 Thread Pablo Landherr
Here is a simple approach: for =: #~ age =: ?20#100 sex =: ?20#2 weight =: 100+?20#100 id =: 1+?20#5000 or =: +. and =: *. id 14652 14290 14262 13100 11264 11129 11414 10030 11792 12598 14282 13212 14154 11130 11584 11355 13035 14807 11608 10123 id for age > 70 11129 12598 14282 13

Re: [Jprogramming] Perm Mystery

2013-05-23 Thread Pablo Landherr
In your analysis, what favours that conclusion and what speaks against it? Kind regards, Pablo On Thu, May 23, 2013 at 1:07 PM, Linda Alvord wrote: >(i.!3)A. i.3 > 0 1 2 > 0 2 1 > 1 0 2 > 1 2 0 > 2 0 1 > 2 1 0 > > Is perm the definition of A. ? > > Linda > > > -Original Message- > F