Saturday, March 30, 2024

Python Tutorial - Angka Random - 012

Hal umum. Python melakukan generating untuk data data random, apakah itu untuk tujuan simulasi, testing dan gaming. 


Image - Ayam Turkey salai

Fungsi "random()" menghasilkan angka diantara 0 dan 1, seperti [0, 0.1 .... 1].

Generating a random float antara 0 dan 1
from random import random
print(random())
output: 0.332587482267

Angka integer antara 1 dan 100
from random import randint
print(randint(1, 100))
Output : 55

Storing Integer di variabel
from random import randint
number = randint(1, 100)
print(number)
Output: 26


Angka Random Float antara 1 dan 10
Kita bisa memakai Fungsi "uniform()"
from random import uniform
print(uniform(1, 10))
Output : 9.7811


Manipulasi Lists dengan Randomness
from random import shuffle
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle(numbers)
print(numbers)
Output: [5, 1, 4, 10, 7, 9, 6, 3, 8, 2]


Menyeleksi Hal Random dari List
from random import sample
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
single_item = sample(numbers, 1)[0]
print(single_item)
Output: 8

multiple_items = sample(numbers, 4)
print(multiple_items)
[7, 5, 10, 4]



Lists mengandung Strings
from random import sample
names = ['Alissa', 'Alice', 'Marco', 'Melissa', 'Sandra', 'Steve']
single_name = sample(names, 1)[0]  # Picks one random name from the list.
print(single_name)
Output: Alissa

multiple_names = sample(names, 4)
print(multiple_names)
Output: ['Alice', 'Marco', 'Steve', 'Melissa']

# Posting sebelumnya:

JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ

Friday, March 29, 2024

Python Tutorial - Casting - 011

Bahasa Python bisa mengenal type type data apakah itu type data integer atau string secara otomatis. 


Image - Hanya Ilustrasi saja

Hanya contoh: x = 3 adalah intiger, sedangkan y = "text" adalah string. 

Casting Data
x = 3
y = 2.153

Print("We have defined two numbers")
print("x = " + str (x))....>wrong
print("y = " + str (y))....> Wrong
Output: error

Correction of program
Print("We have defined two numbers")
print("x = ", x)
print("y = ", y)
Output:
We have defined two numbers
('x =', 3)
('y =', 2.153)

# Posting sebelumnya:

JJJJJJJJJJJJJJJJJJJ

Monday, March 25, 2024

Data Engineering - Microsoft Certificates

"Data engineers focus on designing, building, and maintaining data pipelines and infrastructure. They ensure that data is collected, processed, and made available for analysis."


Image 01 - Data Engineering (credit: Google)

Skills Needed:
- Proficiency in programming languages (e.g., Python, Java, Scala).
- Knowledge of databases (SQL and NoSQL).
- Experience with cloud platforms (e.g., Azure, AWS, Google Cloud).
- Understanding of data modeling, ETL (Extract, Transform, Load) processes, and data warehousing.




Image 02 - Goreng ikan, ilustrasi


JJJJJJJ 

Saturday, March 23, 2024

Python Tutorial - Dictionary - 010

Dictionary adalah seperangkat nilai (set of value) yang tidak beraturan dalam sepasang kurung: { } 



Image - Bumbu Nasi Goreng

Angka integer (angka 1, 2, 3....) and string (kata, halo, apa kabar dsb) bisa dipakai dalam index dictionary. 

Dictionary sederhana:
words = { }
words["Hello"] = "Bonjour"
words["Yes"] = "Oui"
words["No"] = "Non"
words["Bye"] = "Au Revoir"

print(words["Hello"])
Output = Bonjour

print(words["No"])
Output = Non


Limited to single word definitions
dict = { }
dict["Ford"] = "Car"
dict["Python"] = "The Python Programming Language"
dict[2] = "This sentence is stored here"

print(dict["Ford"])
Output : Car

print(dict["Python"])
Output: The Python Programming Language

print(dict["2"])
Output: The Python Programming Language ....> salah
Note: code ["2"]), diganti menjadi [2])

print(dict[2])
Output: This sentence is stored here


Manipulating the Dictionary
words = {}
words["Hello"] = "Bonjou"
words["Yes"] = "Oui"
words["No"] = "Non"
words["Bye"] = "Au Revoir"

print(words)
Output: {'Hello': 'Bonjou', 'Yes': 'Oui', 'No': 'Non', 'Bye': 'Au Revoir'}

del words["yes"]
print(words)

words["yes"] = "Oui"
print(words)

# Previous postings:

JJJJ

Friday, March 22, 2024

Python Tutorial - Tuple - 009

Tuple adalah struktur data penting dalam Python, digunakan untuk menyimpan koleksi data yang relevan. 


Image - Bunga Tulip, hanya ilustrasi. 

Perbedaan antara Tuple dan List bahwa Tuple setelah dikreasi tetap seperti itu, tidak berubah.

Mengakses Tuple data.
Seperti list, Tuple adalah index:
    personInfo = ("Diana", 32, "New York")
    print(personInfo[0])
Output: Diana
    print(personInfo[1])
Output: 32

Tuple bisa melakukan operasi beberapa variabel secara bersamaan:
name, age, country, career = ("Diana", 32, "Canada", "CompSci")
print(country)
Output: Canada


Modifikasi Tuple.
Meskipun anda tidak bisa mengubah content Tuple, tapi anda bisa menambah dua Tuples dengan operator: +
x = (3,4,5,6)
x = x + (1,2,3)
print(x)
Output: (3, 4, 5, 6, 1, 2, 3)

# Previous postings:

JJJJJJJJJJJ

Wednesday, March 20, 2024

Sofware Testing Tutorial

 Software testing adalah salah satu lapangan kerja yang sedang trending dengan gaji yang cukup lumayan besar.

Image - Musim shopping telah tiba

Hanya sekedar pengantar, anda bisa mengetahui apa itu Software Testing melalui beberapa website ini:
1) Software testing untuk pemula:

2) Software testing tutorial fundamental, sebelum latihan proyek/praktek: 

3) Proyek/praktek software testing:

4) Automation testing:

Info dari Linkedin:
"The software testing field is becoming increasingly popular, which means there is a lot of competition for jobs. With so many applicants, it can be tough to stand out from the crowd. This is especially true for junior testers, who may not have as many accomplishments or accolades to highlight on their resumes. 

To overcome this obstacle, focus on developing your unique skills and strengths. Consider taking courses or certifications that will help you stand out from other candidates. For example, you might focus on learning a particular testing methodology, such as Agile or DevOps, or specialize in a particular area of testing, such as automation or performance testing. By showcasing your unique skills and expertise, you can differentiate yourself from other candidates and increase your chances of landing a job."

# Posting sebelumnya:
JJJJJJJJJJJJJJJJJJJ 

Python Tutorial - Range - 008

Fungsi range adalah hal umum dipakai dalam bahasa Python. Dipakai untuk menghasikan deretan angka berdasarkan parameter khusus. 


Image - Ruko di kota kecil Amerika

range(start, stop, step)
start, stop, step .....> disebut parameter

Parameter start .....> starting value .....> default value is 0 (zero)
Parameter stop .....> upper limit
Parameter step .....> interval between numbers ....> default value is 1

# range(0,5)
Note: To make the code range(0,5) work, you can convert it to a list. In Python, the range() function generates a sequence of numbers, but it doesn’t create a list directly. To create a list containing the numbers from 0 to 4, you can use the list() function to convert the range to a list:

>>> my_list = list(range(0, 5))
>>> print(my_list)
[0, 1, 2, 3, 4]
>>> 


# range(1,6)
my_list = list(range(0,6))
print(my_list)
output : [0, 1, 2, 3, 4, 5]

# range(6, 0, -1)
result = list(range(6, 0, -1))
print(result)
output: [6, 5, 4, 3, 2, 1]

# range(0, -10, -2)
badut = list(range(0, -10, -2))
print(badut)
Output: no output


## Posting sebelumnya:
JJJJJJJJJJJJ

Tuesday, March 19, 2024

Python Tutorial - Loop - 007

Untuk kondisi khusus, eksekusi code bisa diulang (repeat), untuk itu Python menyediakan mekanisme yang disebut "loop." 


Image - Di pedesaan, ilustrasi.

Struktur loop dalam Python adalah: for, while dan nested loops.

Loop "for" dipakai untuk pengulangan "objects" seperti lists, strings dan tuples.
items = ["agus", "benu", "cica", "deli"]

for item in items:
    print(item)
Output: 
agus
benu
cica
deli
>>> 

Using "range"
range() function to make easy to make repeatition
for i in range(1, 10):
print(i)
output:
1
2
3
4
5
6
7
8
9
>>> 


Loop "While"
correctNumber = 5
guess = 0

while guess != correctNumber:
    guess = int(input("Guess the number: "))
if guess != correctNumber:
print('False guess')

print('You guessed the correct number')
Note : No output


Nested Loops
for x in range(1, 10): for y in range(1, 10): print("(" + str(x) + "," + str(y) + ")") SyntaxError: expected an indented block

# Posting sebelumnya:

JJJJJJJJJ

Monday, March 18, 2024

Python Tutorial - Scope - 006

Pada posting lalu kita bicara soal variabel lokal dan variabel general. Nah, dua variabel ini disebut variable, berdasarkan scope yang kita bicarakan.



Image - Jalan desa di Amerika.

Contoh Python Scope
# The code will not work
def f(x,y):
    print('you called f(x,y) with the value x = ' + str(x) + ' and y = ' + str(y))
    print('x + y = ' + str(x*y))
    z = 4 # z is lokal

z = 3
f(3,2)


# Function scope make code can be used
def f(x,y):
    g=3
    print('you called f(x,y) with the value x = ' + str(x) + ' and y = ' + str(y))
    print('x + y = ' + str(x + y)) # x + y, not x * y
    print(g)

f(3,2)
Output: 
you called f(x,y) with the value x = 3 and y = 2
x + y = 5
3
>>> 


Another example:
def f(x,y,z):
    return x+y+y

result = f(3,2,3)
print(result)
Output: 7 ....> because: x + y + y = 3+2+2 = 7


Nested functions and variabel scope
def highFive():
    return 5

def f(x,y):
    g = highFive()
    return x+y+g

result = f(3,2)
print (result)
Output= 10

# Posting sebelumnya:

Sunday, March 17, 2024

Python Tutorial - Global variables and Local variables - 005

 Ada dua variable penting, yaitu variabel global dan variabel lokal. Dari namanya, bisa anda tebak sendiri perbedaannya. 


Image 01 - Bangunan di kota kecil.

Local variabel dibatasi atau terbatas, sedangkan global variabel bisa diakses melalui coding.


Image 02 - Z = local variable, while x = global variable.

Contoh local variable.
Untuk contoh ini, local variable adalah x dan y.
def sum(x,y):
sum = x + y
    return sum

print(sum(7,7))
output: none, should be 14

print(my_sum(7, 7))
output: error

print(x)
output: error....> outside definisi


Contoh Variabel Global
contoh 1) 
g = 10

def afunction():
    global g
    print(g)

afunction()
output: 10
    print(g)
output: 10

Contoh 2) Modify global variabel...> Outside or inside definisi
g = 11

def afunction():
    global g
    g = 8

afunction()
print(g)
output: 8


Exercise
 g = 10

def func1():
    global g
    g = 3

def func2(x,y):
    global g
    return x+y+g

func1()
total = func2(4,5)
print(total)
output = 12

# Posting sebelumnya:

Friday, March 15, 2024

BEST Data Analytics Certifications

Tidak ada aktifitas dalam kehidupan sehari hari tanpa melibatkan data, sehingga "data anayst" adalah salah satu profesi yang dibutuhkan saat ini. 


Image - Sertifikasi Data Analytics

Siapa saja bisa menjadi data analist, meskipun tanda gelar sarjana komputer, bahkan tanpa gelar sarjanan sama sekali. 

Caranya?

Silahkan ikuti petunjuk di website atau youtube di bawah ini.

Beberapa website atau sumber untuk dapatkan gambaran:
1) 7 BEST Data Analytics Certifications

2) Jadi data analytic dalam 6 bulan:

3) Data Science Vs Data analytic:

4) Google Data Analytics Certificates:

5) Free Data Analytics Courses

# Posting sebelumnya:
https://upgrlive.blogspot.com/2018/12/kepiting-biru-fresh-baik-untuk.html




JJJJJJJJJJJJJ
JJJJJJJJJJJ

Tuesday, March 12, 2024

Python Tutorial - Functions - 004

Function dalam Python sangat penting, diantara gunanya adalah untuk mendisain "codes" (blok code). Sehingga meningkatkan efisiensi program yang dirancang.


Image 01 - Sepiring nasi dan lauknya, ilustrasi.

Selanjutnya, Fungsi bisa dipakai untuk: 
- mengurangi pengulangan,
- meningkatkan klarifikasi "codes"
- testing dan modifikasi

Simple Python Function
1) example:
def square(x):
return x * x

print(square(5))

>>> def square(x):
return x * x

>>> print(square(5))
output: 25

2) Multiple parameters
def multiply(x,y):
    print(f'You called multiply(x,y) with the values x = {x} and y = {y}')
    print(f'x * y = (x * y = {x * y}')

multiply(4, 2)
output= 
Note: error

# Previous postings: