MCPcopy
hub / github.com/pandas-dev/pandas / function

Function function

pandas/plotting/_matplotlib/misc.py:234–257  ·  view source on GitHub ↗
(amplitudes)

Source from the content-addressed store, hash-verified

232 import matplotlib.pyplot as plt
233
234 def function(amplitudes):
235 def f(t):
236 x1 = amplitudes[0]
237 result = x1 / np.sqrt(2.0)
238
239 # Take the rest of the coefficients and resize them
240 # appropriately. Take a copy of amplitudes as otherwise numpy
241 # deletes the element from amplitudes itself.
242 coeffs = np.delete(np.copy(amplitudes), 0)
243 coeffs = np.resize(coeffs, (int((coeffs.size + 1) / 2), 2))
244
245 # Generate the harmonics and arguments for the sin and cos
246 # functions.
247 harmonics = np.arange(0, coeffs.shape[0]) + 1
248 trig_args = np.outer(harmonics, t)
249
250 result += np.sum(
251 coeffs[:, 0, np.newaxis] * np.sin(trig_args)
252 + coeffs[:, 1, np.newaxis] * np.cos(trig_args),
253 axis=0,
254 )
255 return result
256
257 return f
258
259 n = len(frame)
260 class_col = frame[class_column]

Callers 2

mainFunction · 0.85
andrews_curvesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected