Categories

## Given 2 String array and count the number of islands(not leetcode question)

I have some trouble coding a task that is beyond my capability. The problem gives you two String array, for example: No1[A,B,B,C,B,D,F,G] No2[E,E,C,D,D,E,H,H] and the same index in those two arrays will connect and form islands,just like the following graph enter image description here and it returns two islands. I tried to solve the problem […]

Categories

## Best way to architecture a Pokemon class

This is gonna be a doozie to explain, but thanks for reading. Pokemon knowledge is essential for understanding. So my first idea, which is obviously the correct one, was to make a Pokemon class. I even made subclasses like “PokemonInfo” and “PokemonStats” which acted like directories for information, and made instantiating a Pokemon not all […]

Categories

## Send # as keystroke with auto hotkey

We are working on a AHK program where we need to send # as a keystroke. We already tried Send, # but doesnt work. Couldnt find the right keystroke in the list: https://www.autohotkey.com/docs/KeyList.htm Full program looks like this: ^q:: Send, ( ^f # )

Categories

## Proving that a diagram involving associators and unitors commutes in a bicategory

In a bigategory, by coherence, the following equation holds for all $f : x \to y$ and $g : y \to z$: $$\rho_{g * f} \; = \; \textit{id}_g * \rho_f \; \circ \; \alpha_{g, f, I_x}$$ Diagrammatically: How do you prove it starting from the usual triangle and pentagon coherence axioms? Mumbling […]

Categories

## Identify missing elements from another dataset per group

I have two datasets both containing a common field but would like to retrieve all of the missing elements of one dataset compared to the other one. My df1 looks like this: Account.ID Product.ID 1 A 1 B 1 C 1 D 2 A 2 E 2 F 3 B 3 D And my other […]

Categories

## Is $0$ an eigenvalue of matrix?

We have $A$, $B$, $C$, $D$, $E$ and $F$ which are $n \times n$ matrices ($n≥3$). If $det(ABC)=0$, $B$ is invertible, $rank(C)=n$, nullity of $D$ is 2, matrix $E$ columns span $R^n$ subspace which has dimension 1 and $det(DEF)=0$. The question is that is $0$ an eigenvalue of any of these following matrices: $A$, $B$, […]

Categories

## Check if pandas column contains all elements from a list

I have a df like this: frame = pd.DataFrame({‘a’ : [‘a,b,c’, ‘a,c,f’, ‘b,d,f’,’a,z,c’]}) And a list of items: letters = [‘a’,’c’] My goal is to get all the rows from frame that contain at least the 2 elements in letters I came up with this solution: for i in letters: subframe = frame[frame[‘a’].str.contains(i)] This gives […]

Categories

## Proving that a diagram involving associators and unitors commutes in a bicategory

In a bigategory, by coherence, the following equation holds for all $f : x \to y$ and $g : y \to z$: $$\rho_{g * f} \; = \; \textit{id}_g * \rho_f \; \circ \; \alpha_{g, f, I_x}$$ Diagrammatically: How do you prove it starting from the usual triangle and pentagon coherence axioms? Mumbling […]

Categories

## how to summarise multiple logistic regression models in a table?

I have a dataset with age as continuous and as a factor, sex as a factor and 4 groups. logistic_s <- data.frame( ID = c(1:6), Age = c(9, 12, 16, 57, 29, 24), Age1 = factor(c(1, 2, 2, 6, 3, 3)), Sex = factor(c(“F”, “M”, “F”, “M”, “F”, “F”)), N = c(rep(1, 6)), G = […]