Categories
Mastering Development

How to optimize a function that matches observations according to certain criteria

I am looking for a more efficient way of doing an operation with a given dataframe. library(purrr) library(dplyr) Here is a step by step description: First, there is the function possible_matches, that for each observation i in df, gives the index of rows that are possibly matchable to i, which are going to be used […]

Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
User Help

Format Excel to show proper date information

I have a very large .csv. If I print the first line of the file it looks as follows. 2020/01/01 00:00:47.069, ZoneStatistics, 1955786687, 02 Adv, 1, 0, 19, However when I open it in excel… 43831.00054, ZoneStatistics, 1955786687, 02 Adv, 1, 0, 19, If I change the format of the first column to date, no […]

Categories
Mastering Development

combining data and putting zeros in non-existent abbreviations in R

How can i combine data in this way? in this dataset forest=structure(list(ADR.N.14.0 = c(8140010250001, 8140010250002, 8140010250005 ), Соста.C.254 = structure(c(3L, 1L, 2L), .Label = c("10WB", "6AS 4WB", "7AS 3WB"), class = "factor"), PLSVYD.N.16.6 = c(3, 2, 36), PRBPOR.C.254 = structure(c(1L, 2L, 1L), .Label = c("AS", "WB"), class = "factor"), NOMYAR.N.16.6 = c(1, 1, 1), KOFPOR1.N.16.6 […]

Categories
Mastering Development

How to put numbers into a list from a for loop

I am currently just testing a library that is matplotlib.pyplot and I want to just graph a series of numbers I have calculated inside of a for loop. How would I place these numbers inside of a list so I can plot the numbers accordingly on the Y and X axis? Here is my code […]

Categories
Mastering Development

t test x not enough ‘x’ observations using R with package rstatix

I have the following dataset: structure(list(AgeGroup = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, […]

Categories
Mastering Development

combining data and putting zeros in non-existent abbreviations in R

How can i combine data in this way? in this dataset forest=structure(list(ADR.N.14.0 = c(8140010250001, 8140010250002, 8140010250005 ), Соста.C.254 = structure(c(3L, 1L, 2L), .Label = c("10WB", "6AS 4WB", "7AS 3WB"), class = "factor"), PLSVYD.N.16.6 = c(3, 2, 36), PRBPOR.C.254 = structure(c(1L, 2L, 1L), .Label = c("AS", "WB"), class = "factor"), NOMYAR.N.16.6 = c(1, 1, 1), KOFPOR1.N.16.6 […]

Categories
Database Development

Passing column names into dynamic SQL in stored proc

I am trying to create a procedure which will dynamically create a unique table name, populate the table with a result set returned from another procedure, and return the table name to the caller. In outline, it looks something like this CREATE OR REPLACE FUNCTION return_result_table( _param1 integer[], _param2 text[]) RETURNS text LANGUAGE ‘plpgsql’ COST […]

Categories
Mastering Development

tf.keras: feeding bool type variable along the input in model.fit method

I am building a model and I need to pass a bool type variable with True value with model.fit method and with False value with model.predict because I want need to run a condition(tf.condition or switch) function that works differently when the conditional bool variable is true or false. When I tried to feed it […]

Categories
Mastering Development

Is there a way to get the starts and ends of numbers between a split from an array?

Sorry, I don’t even know what title to give this problem. I have an array of numbers I call pages. They are pages I need to print out physically from say a browser. pagesToPrint = [2,3,4,5,7,8,9,12,14,15,16,17,18,19,20] Now, what is the problem with just printing 2,3,4,5,7…20? When a page or pages are sent to the printer […]