Fft-And-Ifft

Fri 14 November 2025

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])
x
array([1, 2, 4, 5])
y = fft(x)
y
array([12.+0.j, -3.+3.j, -2 …

Category: scipy

Read More

Fibonacci

Fri 14 November 2025

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)
print(fib(8))
21
print(fib(89))


Score: 5

Category: basics

Read More

Fibonacci-1

Fri 14 November 2025

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]'
print(pyu.ps2("scipy"))
scipy==1.14.1
def get_fib(n):

    if n <= 1

    return 0
get_fib(5)
0
# 5 = 5 + 4 + 3 + 2 +1 = 
def …

Category: assignments

Read More

Fibonacci-Generator

Fri 14 November 2025

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
print(2)
2
for x in fibonacci(10):
    print(x)
1
1
2
3
5
8
13
21
34 …

Category: basics

Read More

Fibonacci Lambda

Fri 14 November 2025

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))))
print_fibo(6)
[1, 1, 2, 3 …

Category: basics

Read More

File-Size-Finder

Fri 14 November 2025

title: "Current Location" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


cmd = 'du -sh /tmp/datasets'
!{cmd}
 17M    /tmp/datasets

Score: 0

Category: file-utils

Read More

File-To-Dictionary

Fri 14 November 2025

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 …

Category: gensim-samples

Read More

Fill-Na-With-Average

Fri 14 November 2025

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')
df
student language science maths …

Category: data-wrangling

Read More

Fill-Random-Marks

Fri 14 November 2025

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)
df

Category: data-wrangling

Read More

Filter-Between

Fri 14 November 2025

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')
df
student language science maths history
0 …

Category: data-wrangling

Read More
Page 101 of 146

« Prev Next »