Categories

## Combinatorial optimization (find partitions)

A problem arose to solve the problem with a solution that became impracticable. Well, I have a set of 12 elements that represent quantities: $$\Omega = \{16, 132, 135, 135, 136, 138, 138, 139, 301, 334, 355, 361\}$$ I can join elements, get subsets, of this set such that the sum of the elements does […]

Categories

## Combinatorial optimization (find partitions)

A problem arose to solve the problem with a solution that became impracticable. Well, I have a set of 12 elements that represent quantities: $$\Omega = \{16, 132, 135, 135, 136, 138, 138, 139, 301, 334, 355, 361\}$$ I can join elements, get subsets, of this set such that the sum of the elements does […]

Categories

## finding the closest value in a list

I’m trying to take a value from a list and find the closest value from another list, and sort it so it’s the same.. I’m not good at explaining.. here’s my code: list1 = [[111, 111], [222, 222], [333, 333]] list2 = [[223, 223], [112, 112], [334, 334]] #I need to find the closest value, […]

Categories

## Two-Way Repeated Measures ANOVA: Error in lm.fit()… 0 non-na cases (rstatix)

I am trying to run a Two-Way Repeated Measures ANOVA using the R Statix package based on the description from here however I am running into the subject error with my dataset. The data consist of 10 replicate biomass measurements recorded at each of 8 Locations across 5 months (10 reps x 8 locations x […]

Categories

## how to unselected all legends except the other one legend it shouldn’t unselected in echarts

here’s the code: const _this = this; const legendList = new Array(); legendList.push(“邮件营销”, “联盟广告”, “视频广告”, “直接访问”, “搜索引擎”) this.option = { title: { text: “堆叠区域图” }, tooltip: { trigger: “axis”, axisPointer: { type: “cross”, label: { backgroundColor: “#6a7985” } }, formatter: function(param: any) { let res = param.name + “<br/>”; for (let x = 0; x […]

Categories

## Named List Creates Runtime Warning

I am checking run times on factorials (have to use the user-defined function), but I receive an odd error. Code I’m working with is as follows: import numpy as np import time np.random.seed(14) nums = list(np.random.randint(low=100, high=500, size=10)) # nums returns as [207, 444, 368, 427, 349, 458, 334, 256, 238, 308] def fact(x): if […]

Categories

## How to minimize the sum of the elements in the final array after performing k number of operation

This question is asked in my interview coding and there were 12 test cases and i am only able to pass 8 of them. minSum(List values, int k) method need to complete. Example : nums = [10,20,7] and k=4 ans answer for this array is 5+5+4=14. Each operation consists of removing element from the array, […]

Categories

## Parsing a .pdb file in Python and creating a dictionary for specific record types

First, let me start by saying that I’m doing this as a Python exercise and I’m not allowed to use Biopython. I am writing a script that will help me parse any .pdb file generated from a trajectory. I am trying to create a dictionary that would link the chain variable with the resNumber variable. […]

Categories

## How to fix Python Gekko Max Equation Length error

My code work on small variables. But when I do in 128*128 array of variables, the error below is appearing: APM model error: string > 15000 characters Consider breaking up the line into multiple equations The may also be due to only using newline character CR instead of CR LF (for Windows) or LF (for […]

Categories

## How to get extremes from already determined groups of peak/valley indexes? [python]

I’m sorry if i’m butchering the question but essentially i have 3 arrays. One array which is the signal data, and an array of peak indexes and an array of valley indexes. The problem however is that sometimes there will be multiple indexes for a peak in a row before there is a valley index. […]