Fft-And-Ifft
title: "FFT and IFFT"
author: "Raja CSP Raman"
date: 2019-05-06
description: "-"
type: technical_note
draft: false
from scipy.fftpack import fft, ifft
import numpy as np
x = np.array([1, 2, 4, 5])
array([12.+0.j, -3.+3.j, -2 …
Read More
Fibonacci
title: "Fibonacci"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
def fib(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
Score: 5
Read More
Fibonacci-1
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct 3 2024, 07:29:13) [GCC 11.2.0]'
def get_fib(n):
if n <= 1
return 0
Read More
Fibonacci-Generator
title: "Fibonacci in Generator"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
def fibonacci(n):
a = b = 1
for i in range(n):
yield a
a, b = b, a+b
for x in fibonacci(10):
print(x)
Read More
Fibonacci Lambda
title: "Fibonacci Lambda"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
def print_fibo(number):
print(list(map(lambda x, f = lambda x, f : (f(x-1,f) + f(x-2,f)) if x > 1 else 1: f(x,f), range(number))))
Read More
File-Size-Finder
title: "Current Location"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
cmd = 'du -sh /tmp/datasets'
!{cmd}
Score: 0
Read More
File-To-Dictionary
title: "File To Dictionary"
author: "Raja CSP Raman"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
import gensim
from gensim import corpora
from gensim.utils import simple_preprocess
from smart_open import smart_open
import os
dictionary = corpora.Dictionary()
# Create gensim dictionary form a single tet file
dictionary = corpora.Dictionary(simple_preprocess(line, deacc=True …
Read More
Fill-Na-With-Average
title: "Fill NA with Average"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('abc2.csv')
|
student |
language |
science |
maths … |
Read More
Fill-Random-Marks
title: "Fill Random Marks"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
datatype = [('Science', 'int32'), ('Maths', 'int32')]
current_values = np.zeros(3, dtype=datatype)
current_index = ['Row '+str(i) for i in range(1, 4)]
df = pd.DataFrame(current_values, index=current_index)
Read More
Filter-Between
title: "Filter Between"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('marks.csv')
|
student |
language |
science |
maths |
history |
| 0 … |
Read More