Quick-Sort

Sat 17 May 2025

title: "Quick Sorting" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


def quicksort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x …

Category: basics

Read More

Random-Binary

Sat 17 May 2025

title: "Random Binary" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import random
MAX = 10

for x in range(MAX):
    val = random.randint(0, 1)
    print(val)
0
1
1
0
1
0
1
1
0
0


Score: 0

Category: basics

Read More

Random-Max

Sat 17 May 2025

title: "Random Max" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import random
MAX = 8

for x in range(MAX):
    val = random.randint(14, 30)
    print(val)
17
21
27
30
17
22
14
20


Score: 0

Category: basics

Read More

Random-Numbers

Sat 17 May 2025

title: "Random Numbers" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import random as rd
def get_random():
    return rd.randint(0, 100)
get_random()
61
def get_random_year_duration():
    return round(rd.uniform(1,2), 1)
get_random_year_duration()
1.6
def get_random_price():
    return round(rd.uniform(1, 100), 2)
get_random_price()
43.21
def …

Category: basics

Read More

Random Timestamp

Sat 17 May 2025

title: "Random Timestamp" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


from random import randrange
import datetime
def random_date(start,l):
   current = start
   while l >= 0:
      curr = current + datetime.timedelta(minutes=randrange(60))
      yield curr
      l-=1
def get_random_timestamp(max):
    startDate = datetime.datetime(2013, 9, 20,13 …

Category: basics

Read More

Range With Even Numbers

Sat 17 May 2025

title: "Range with Even Numbers" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


for x in range(0, 10, 2):
    print(x)
0
2
4
6
8
for x in range(0, 100, 10):
    print(x)
0
10
20
30
40
50
60
70
80
90


Score …

Category: basics

Read More

Read-Github-Csv

Sat 17 May 2025

title: "Read GitHub CSV" author: "Raja CSP Raman" date: 2020-09-05 description: "-" type: technical_note draft: false


from io import BytesIO
import requests
import pandas as pd
FILEPATH = 'https://raw.githubusercontent.com/rajacsp/public-dataset/master/zynicide-wine-reviews/winemag-data-130k-v2.csv'

r = requests.get(FILEPATH)
data = r.content

onlinedata = BytesIO(data)
df = pd.read_csv(onlinedata …

Category: basics

Read More

Read-Gitlab-Csv

Sat 17 May 2025

title: "Read GitLab CSV" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


from io import BytesIO
import requests
import pandas as pd
filename = 'https://gitlab.com/rajacsp/datasets/raw/master/FEELI%20SONG%20LIST%20-%20Songs.csv'

r = requests.get(filename)
data = r.content

onlinedata = BytesIO(data)
# onlinedata …

Category: basics

Read More

Read-Google-Csv

Sat 17 May 2025

title: "Read Google CSV" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


from io import BytesIO
import requests
import pandas as pd
filename = 'https://docs.google.com/spreadsheet/ccc?key=1EfyD7A4YcdAzTfUO0t3yQ0HawetVF5pefS5pPyGVX4g&output=csv'

r = requests.get(filename)
data = r.content
df = pd.read_csv(BytesIO(data), index_col=0 …

Category: basics

Read More

Read-Google-Csv-With-Date

Sat 17 May 2025

title: "Read Google CSV with Date" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


from io import BytesIO
import requests
import pandas as pd
filename = 'https://docs.google.com/spreadsheet/ccc?key=0Ak1ecr7i0wotdGJmTURJRnZLYlV3M2daNTRubTdwTXc&output=csv'

r = requests.get(filename)
data = r.content
df = pd.read_csv(BytesIO(data …

Category: basics

Read More
Page 11 of 17

« Prev Next »