Random-Binary

Fri 14 November 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-Int-Single-Param

Fri 14 November 2025

title: "Random Param Single Param" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(5, size = (5, 4)))
df

Category: data-wrangling

Read More

Random-Int-With-2-Dim

Fri 14 November 2025

title: "Random Integer with 2 dimension" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
# Create Random integer between 1 to 100

df = pd.DataFrame(np.random.randint(0, 100, size=(2, 4)), columns=['A', 'B', 'C', 'D'])
df

Category: data-wrangling

Read More

Random-Integer

Fri 14 November 2025

title: "Random Integer between 2 and 10" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
a = np.random.randint(2, 10, size=4)
print(a)
[8 4 5 3]

Score: 0

Category: data-wrangling

Read More

Random-Max

Fri 14 November 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-Number-Plot

Fri 14 November 2025

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


import numpy as np
import matplotlib.pylab as plt
a = np.random.randint(10, size=20)
a
array([2, 5, 5, 4, 9, 0, 4, 9, 0, 1, 9, 7, 9, 7, 1, 5, 7 …

Category: plot

Read More

Random-Numbers

Fri 14 November 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-Plot-10Years

Fri 14 November 2025

title: "Random Plot 10 years" author: "Rj" date: 2019-05-06 description: "List Test" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(4000, 4), index=pd.date_range('1/1/2000', periods=4000), columns=list('ABCD'))
df.head()

Category: plot

Read More

Random-Plot-Simple

Fri 14 November 2025

title: "Random Plot Simple" author: "Rj" date: 2019-05-06 description: "List Test" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(100, 4), index=pd.date_range('1/1/2000', periods=100), columns=list('ABCD'))
df.head()

Category: plot

Read More

Random Timestamp

Fri 14 November 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
Page 123 of 146

« Prev Next »