From dev-return-1595-apmail-systemml-dev-archive=systemml.apache.org@systemml.incubator.apache.org Mon Apr 17 17:39:06 2017 Return-Path: X-Original-To: apmail-systemml-dev-archive@minotaur.apache.org Delivered-To: apmail-systemml-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65F9518A84 for ; Mon, 17 Apr 2017 17:39:06 +0000 (UTC) Received: (qmail 17571 invoked by uid 500); 17 Apr 2017 17:39:06 -0000 Delivered-To: apmail-systemml-dev-archive@systemml.apache.org Received: (qmail 17521 invoked by uid 500); 17 Apr 2017 17:39:06 -0000 Mailing-List: contact dev-help@systemml.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.incubator.apache.org Delivered-To: mailing list dev@systemml.incubator.apache.org Received: (qmail 17507 invoked by uid 99); 17 Apr 2017 17:39:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2017 17:39:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7E71518FCE4 for ; Mon, 17 Apr 2017 17:39:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.629 X-Spam-Level: * X-Spam-Status: No, score=1.629 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id s7g91QlTLiv3 for ; Mon, 17 Apr 2017 17:39:01 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 223265F405 for ; Mon, 17 Apr 2017 17:39:01 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id f22so149687956oib.2 for ; Mon, 17 Apr 2017 10:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=POLnlmwt8mCI0soCcKqcUV3Pn4hVQ4OGINhdOGBNan8=; b=JpGCddRMBdcCc9W7G7X23WBzOBH6wd6FetnxgjNRqf4kNrgMOwZhft0LXuLBmN1VTc AkEthXbVqaA4IdKyHMU+RKM6bHzaMto1112bydEEKAry1S4iIJA4YaglZolpZ+OaO+PT ue460NE5gTFcMnYidvuq15uN42Lvo+KtX+vb0VDsQDx3iPN01GsPH45PbbhP9l8Sv7KR nn8kMFanCzl7VgoKRMH0m4Eu6QlNzphbuHqfvg4EQapAkTkQ2AfVyV0ACRuzluphnZCU oYaaiET0lshF6KzLSanVkE9rXceLckX+zK+ZRwuVyIDHGNv+43HcQDj9Hl5Gl/YSIGVr aJTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=POLnlmwt8mCI0soCcKqcUV3Pn4hVQ4OGINhdOGBNan8=; b=Geiek3Tg2fRV6GNKAZkB85vqary6rr5zSHpzRWt4Yyp5etyeLvsDQ3DF03y+Qdps0l y49U0MRbYy3bM1Xutp20oioqW5dMwihHstXSbo7+XQ2L8UXVTtbZUkpJTsd3oArVJ4l1 bRLOXNHowWrXzgXC7pOuGcnuGLJnxSUYKcuqzM/IClQPW0NMeQ3vJ3mgNHSO4i7JrZj0 Bs3r8dvNukaV3oxlykIkCvG+7OfTIFLDXMdmKp/oIIfFAxalWOURyfDc83QLaJXNNjp9 jlADgu/k/bM0N/oIRr2cemrFNqKxtxySEG2o/HE+JqubsZNoUN7Ydb3AAlhXCme1R898 Flvw== X-Gm-Message-State: AN3rC/5Fjyt0q59naKB+NOos4c/0v5D+bAIEqUZ3NAU9ka8rzBXiu/Ab RqBG1YwPBexKgHlM X-Received: by 10.202.253.84 with SMTP id b81mr3747631oii.54.1492450734834; Mon, 17 Apr 2017 10:38:54 -0700 (PDT) Received: from ?IPv6:2602:306:cdd1:58f0:2810:2d67:1fd7:9235? ([2602:306:cdd1:58f0:2810:2d67:1fd7:9235]) by smtp.googlemail.com with ESMTPSA id t137sm2827967oif.4.2017.04.17.10.38.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Apr 2017 10:38:54 -0700 (PDT) From: Matthias Boehm X-Google-Original-From: Matthias Boehm Subject: Re: SystemML query To: dev@systemml.incubator.apache.org References: Message-ID: <1f5e26d7-444e-1709-81da-e5b00c3d5a9e@gmail.com> Date: Mon, 17 Apr 2017 10:38:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit if your data X is already ordered you can do the following: I = rbind(matrix(1,1,1), (X[1:nrow(X)-1,]!=X[2:nrow(X),])); dX = removeEmpty(target=X, margin="rows", select=I); Regards, Matthias On 4/17/2017 8:40 AM, arijit chakraborty wrote: > > Hi, > > I've an issue regarding finding and removing the duplicate in a column/ row of a matrix. I'm tried this method: > > duplicate_matrix = matrix("1 2 3 3 3 4 5 6", rows = 8, cols = 1) > > dup_ind = matrix(1,rows = nrow(duplicate_matrix),cols = 1) > a = nrow(dup_ind) > b = nrow(duplicate_matrix) > #Clumsy Unique. Can we check with the systemml guy? > for(i in 2:nrow(duplicate_matrix)){ > if(as.scalar(duplicate_matrix[i,]) == as.scalar(duplicate_matrix[i-1,]) ){ > dup_ind[i,] = 0 > } > } > > > My question is, is there any better way of doing it? In systemML, we don't have method to find/remove/ count duplicate values. > > Thank you! > Arijit > > > ________________________________ > From: Niketan Pansare > Sent: Friday, April 14, 2017 9:14 PM > To: arijit chakraborty > Cc: Matthias Boehm1; Berthold Reinwald > Subject: Re: SystemML query > > Thanks Arijit. I appreciate your feedback. I will convey your concerns to other committers and urge them to be active on stackoverflow too. If you have already posted questions on stackoverflow, please send me the links and I will do my best to answer them :) > > On Apr 14, 2017, at 6:50 AM, arijit chakraborty > wrote: > > Thanks a lot Niketan! I didn’t expect you to reply my question. Actually I was not sure if I can post question in that forum. And hardly people reply on systemML in stackoverflow. > > But from now on I’ll surely post my questions there. I’ve few more questions. > > Thanks a lot again! > > Regards, > Arijit > > Sent from Mail for Windows 10 > > From: Niketan Pansare > Sent: Thursday, April 13, 2017 11:01 PM > To: arijit chakraborty > Subject: Re: SystemML query > > > Hi Arijit, > > I am happy to help, however I would recommend to post question (along with answer) on our mailing list dev@systemml.incubator.apache.org as your question may help others as well :) > > X = matrix(1, rows = 1, cols = 100) > J = matrix("10 20 25 26 28 31 50 67 79", rows=1, cols=9) > J = t(J) # Make J a column vector > I = matrix(1, rows=nrow(J), cols=1) > V = matrix(10, rows=nrow(J), cols=1) > output = table(I, J, V) > > Thanks, > > Niketan Pansare > IBM Almaden Research Center > E-mail: npansar At us.ibm.com > http://researcher.watson.ibm.com/researcher/view.php?person=us-npansar > > arijit chakraborty ---04/13/2017 09:20:38 AM---Hi Niketan, Hope you are keeping well! > > From: arijit chakraborty > > To: Niketan Pansare/Almaden/IBM@IBMUS > Date: 04/13/2017 09:20 AM > Subject: SystemML query > > > > > Hi Niketan, > > Hope you are keeping well! > > I got stuck in a systemML coding problem and don't know where to approach. So mailing you. I know this is not fair, and will not repeat in future. > > My question is the following: > > I've a matrix of 1 row and 100 columns, matrix(1, rows = 1, cols = 100). I've another column matrix of form matrix("10 20 25 26 28 31 50 67 79", rows = 1, cols = 9). I want to add some value say 10, to 100 column matrix using the values of second matrix position indicator. Rest of the columns' values remain the same > > How to do it here? > > Thanks a lot! Regards, > Arijit > > > > >