Questions tagged as 'matriz'

5
answers

Matrix NxM (2D) in Python with Numpy

I'm trying to solve a college activity but I could not transpose the logic into the code. The case is as follows: "The user will enter the integers in the same row separated by space. After the user passes the values, the following values will b...
asked by 16.08.2018 / 01:52
1
answer

Smallest element of a sub-list, in a list

I'm trying to apply heuristics to a code I've been working on right now, but I need to get the smallest element of a list from a list. example: L = [[1, 1, 6], [1, 2, 5], [1, 3, 7], [2, 1, 1], [2, 2, 9], [2, 3, 4], [3, 1, 5], [3, 2,...
asked by 30.07.2018 / 02:58
1
answer

Fill cells with NA by an annual logical sequence in R

I have a dataframe with 25 people and their respective ages from 2012 to 2015, but in a few years the ages have not been filled. id<-c(1:25) idade_2012<-c(21, 18, 19, 25, 20, 12, 12, 13, 14, 29, 40, 11, 15, 14, 24, 16, 14, 12, 13, 14, 12...
asked by 05.04.2018 / 19:46
2
answers

Python: find product of highest value of each array list

Dear Sirs, I already researched a lot before posting my doubt. I'm already discouraged. This is a university job. If you can give me a tip, I appreciate it. The exercise asks: "(c) What is the product of the highest values of each of the li...
asked by 24.02.2018 / 22:46
1
answer

How to make a count of repeated arguments in R

I have a spreadsheet, I have to do some operations on the data, so I exported to the R and manages to select the important arguments, now I need to know how many repeated elements there are in a column: for example PRTR4: 4 VALE5: 20 . . ....
asked by 09.03.2018 / 21:03
1
answer

double free or corruption (out) - Dynamic Allocation in C

In the discipline of Data Structure in the faculty, as an exercise, was passed the implementation of an algorithm that generates the transposed matrix of a given dynamically allocated matrix. I made the implementation and the algorithm is working...
asked by 30.03.2018 / 19:49
2
answers

Array generator in Python

The program does the following: I say the number of rows and columns I want in my array and then assign a value to each column in each row, the problem is that it seems that when I specify the number of rows through the append () it creates a "fa...
asked by 09.02.2018 / 02:33
2
answers

Operations with arrays in C ++

To sum the items of an array (primary diagonal and secondary diagonal) I was able to write the following code. Can someone help me make the code leaner? so I compare the codes ... C ++: And I would like to know if there is any function for this...
asked by 07.08.2017 / 00:49
1
answer

Add the diagonals of an array

I need to make a program that adds diagonals to an array. According to the example ButI'mhavingalotoftrouble.Hereisthecode:#include<stdio.h>#include<math.h>#defineM4#defineN3intmain(){inti,j,soma=0;intmat[M][N]={{1,2,3},{4,5,6},{7,8...
asked by 20.04.2017 / 18:40
2
answers

Matrix segmentation failure

I'm getting the segmentation fault error in the code below: #include <stdio.h> #include <stdlib.h> #define linha 1000 #define coluna 1000 int main() { long double M1[1000][1000]; long double M2[1000][1000]; long double ma...
asked by 24.09.2016 / 22:26