What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-01 23:34:15
Como crear rnn en keras
import numpy import matplotlib.pyplot as plt import pandas import math from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import Reshape from sklearn.preprocessing import MinMaxScaler... Add solution -
Other 2021-10-17 17:08:09
Merge two arrays by satisfying given constraints
def merge(X, Y, m, n): # size of `X` is `k+1` k = m + n + 1 # run if `X` or `Y` has elements left while m >= 0 and n >= 0: # put the next greater element in the next free position in `X[]` from the end if X[m] >... Add solution -
Python 2021-10-14 02:41:03
find all unique substring permutations of a string of a specific length python
import itertools x = "some string" # aList contains all permutations of all lengths of string x aList = [each for eachpermut in [''.join(l) for i in range(len(x)) for l in itertools.combinations(x, i+1)] for each in [''.join(eachpermut) for ea... Add solution -
Python 2021-10-04 03:09:02
logarithmic scale fitting python
fig=plt.figure() ax = fig.add_subplot(111) z=np.arange(1, len(x)+1) #start at 1, to avoid error from log(0) logA = np.log(z) #no need for list comprehension since all z values >= 1 logB = np.log(y) m, c = np.polyfit(logA, logB, 1, w=np.sqrt(y)) # fi... Add solution -
Python 2021-09-25 13:01:03
animate time series python
import numpy as np import matplotlib.pyplot as plt from matplotlib import animation dt = 0.01 tfinal = 1 x0 = 0 sqrtdt = np.sqrt(dt) n = int(tfinal/dt) xtraj = np.zeros(n+1, float) trange = np.linspace(start=0,stop=tfinal ,num=n+1) xtraj[0] = x0 for i ... Add solution
Best helpers
Ranking is empty