SELECT TOP from CTE based on subtraction of 2 column group by another

I have data which is the results from a bunch of CTE and a query and this is where I am at. Query (not including all previous CTE tables): SELECT CustomerCode, SUBSTRING(SerialNumber, CHARINDEX(‘-‘, SerialNumber) + 1, 6) SerialNumber, nbServer, ISNULL(nbImaging, 0) nbImaging FROM Magic WHERE CS_MagicNUmber <> I_MagicNumber OR CS_MagicNUmber IS NULL OR I_MagicNUmber IS… Read More SELECT TOP from CTE based on subtraction of 2 column group by another

How can I create a new array from an original array making use of ONE MORE DIFFERENT ARRAY in Javascript?

Here are two simple arrays, one is an original list, the other is a selected index from the original one. I just want to re-create a new array, based on the selected index array. Here is my code. const list = [{ id: 0, name: "Ken" }, { id: 1, name: "Ryu" }, { id:… Read More How can I create a new array from an original array making use of ONE MORE DIFFERENT ARRAY in Javascript?

Compare two arrays and remove partially matched strings

i’m having trouble filtering an array based on partially matched content from another. var arrayComplete = [ ‘blue.house’, ‘blue.bird’, ‘blue.ocean’, ‘red.chair’, ‘red.curtain’, ‘black.screen’, ‘green.grass’, ‘green.parrot’ ]; var arrayToRemove = [blue, red]; I need to end up with an array that had elements removed based on partial string matchs: For example, in this case, based on… Read More Compare two arrays and remove partially matched strings

How to create a column in a dataframe using filtering for string values from a list?

I have a dataframe of the following format (Actual dataframe contains more than 10000 rows) Occupation Education Engineer High School Neurosurgeon Masters Electrical Engineer Masters Mechanical Engineer Masters Software Engineer Masters Engineer Masters Business Executive Masters Sales Executive Bachelors Neurosurgeon Masters Electrical Engineer Accountant Bachelors Sales Executive Masters I want to add a column based… Read More How to create a column in a dataframe using filtering for string values from a list?

Math.max not filtering an array by highest number

I am trying to return an array containing the highest number of each nested array using the following code: const triangles = [ [6, 7, 10], [9, 3, 6], [6, 3, 5], [6, 13, 12], [7, 12, 8], ]; function test(triangles){ return triangles.filter(triangle => Math.max(…triangle)); } console.log(test(triangles)); It is not filtering anything and simply returning… Read More Math.max not filtering an array by highest number

How to filter a table by a specific array of strings and its order using vanilla JS

So i have been tinkering around with apis and i essentially created a table using vanilla javascript and a very lengthy set of sort commands that filter the table by string. What i would like to achieve is set an object with strings in the order i want to filter by. Taking the example of… Read More How to filter a table by a specific array of strings and its order using vanilla JS

i have an array of objects i wanna check if an elements exist in this array javascript

i have this array of objects data= [ { name: "name1", email: "email1@gmail.com"}, { name: "name2", email: "email2@gmail.com"}, { name: "name3", email: "email3@gmail.com"}, ] i have the email on one of the users "email2@gmail.com" i want to redirect the user in the users page if his email exist in the data array else redirect him… Read More i have an array of objects i wanna check if an elements exist in this array javascript

Pandas filter using one column and replace on another column

I have a dataframe like as below df = pd.DataFrame( {‘stud_id’ : [101, 101, 101, 101, 101, 101, 101, 101], ‘sub_code’ : [‘CSE01’, ‘CSE02’, ‘CSE03’, ‘CSE06’, ‘CSE05’, ‘CSE04’, ‘CSE07’, ‘CSE08’], ‘marks’ : [‘A’,’B’,’C’,’D’, ‘E’,’F’,’G’,’H’]} ) I would like to do the below a) Filter my dataframe based on sub_code using a list of values b)… Read More Pandas filter using one column and replace on another column