Category: Portfolio

  • FreeFire vs. PubG

    FreeFire vs. PubG

    Hi Guys !

    I built this dashboard in Google Sheets to track the Facebook rivalry between FreeFire and PUBG! It uses QUERY formulas and Pivot Tables to automatically summarize all their likes, shares, and comments, showing who’s winning the engagement battle.

    You’re welcome to explore and interact with my interactive dashboard via the link below:

  • API-Pandas

    API-Pandas

    US Debt Data Analysis

    This project analyzes public debt data from the U.S. Treasury’s official API (fiscaldata.treasury.gov). The script fetches real-time “Debt Subject to Limit” data, processes the JSON response, and loads it into a pandas DataFrame for analysis.

    A key analysis step involves grouping the data by debt category (e.g., ‘Public Debt’, ‘Intragovernmental Holdings’) using df.groupby(). The size of these categories is then visualized using .plot(kind='barh') to provide a clear, horizontal bar chart comparing the volume of records for each debt type.

    # Public API 
    # https://github.com/public-apis/public-apis
    import requests
    
    ## test api
    url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts/debt_subject_to_limit"
    
    resp = requests.get(url)
    resp.status_code
    
    ## Check Status code first
    if resp.status_code == 200:
        print("ok")
    else:
        print("Please check the path again")
    
    ## Retrieve data from APO( Fetch content)
    resp.json()
    
    # import data
    import pandas as pd
    if resp.status_code == 200:
        data = resp.json()
        df = pd.DataFrame(data['data'])
    else:
        print(f"Please check the path again. HTTP status code: {resp.status_code}")
    
    #groups df by category, counts the items in each group, and then plots those counts as a horizontal bar chart.
    df.groupby('debt_catg').size().plot(kind='barh'
    
  • Python ATM Class (OOP)

    Python ATM Class (OOP)

    This project is a Python class that simulates the functionality of an ATM using Object-Oriented Programming (OOP). It serves as a practical blueprint for creating individual bank account “objects” that can interact with each other. Key features include methods for deposit, withdraw, check_balance, and transfer between different account instances.

    Click the badge below to run my project in Google Colab:

    Open In Colab
    ## object oriented programing
    # Create a new class 
    class ATM: 
        # init = initialization (Create)
        def __init__(self, name, balance, bank):
            self.name = name
            self.balance = balance
            self.bank = bank
        
        # method => Function which is only create for this class
        def deposit(self, amt):
            self.balance += amt
            print(f"Your balance is {self.balance}")
        
        def withdraw(self, amt):
            if self.balance >= amt:
                self.balance -= amt
                print(f"Your balance is {self.balance}")
            else:
                print("Insufficient Funds")
    
        def check_balance(self):
            print(f"Your balance is {self.balance}")
    
        def transfer(self, amt, other):
            if self.balance >= amt:
                self.balance -= amt
                other.balance += amt
                print(f"Your balance is {self.balance}")
            else:
                print("Insufficient Funds")
    
    

  • Pizza Bot

    Pizza Bot

    Click the badge below to run my project in Google Colab:

    Open In Colab
     1def bot_pizza():
     2    print("Hello ! Welcome to PizzaKrub :)")
     3    menus = {"Hawaiian $": 5, "Pepperoni $": 4, "Seafood $": 6}
     4    my_cart = {"Hawaiian pcs.": 0, "Pepperoni pcs.": 0, "Seafood pcs.": 0}
     5    cost = 0
     6    while True:
     7        print("What can I help you today?")
     8        action = input("Please choose one [1] Order [2] See the menu [3] Your cart [4] Checkout :")
     9        if action == "1":
    10            print("What can I get for you today?")
    11            while True:
    12                order = input("Please choose one [1] Hawaiian [2] Pepperoni [3] Seafood [4] Back :")
    13                if order == "1":
    14                    my_cart["Hawaiian pcs."] += 1
    15                    cost += menus["Hawaiian $"]
    16                    print("Hawaiian pc. added")
    17                    break
    18                elif order == "2":
    19                    my_cart["Pepperoni pcs."] += 1
    20                    cost += menus["Pepperoni $"]
    21                    print("Pepperoni pc. added")
    22                    break
    23                elif order == "3":
    24                    my_cart["Seafood pcs."] += 1
    25                    cost += menus["Seafood $"]
    26                    print("Seafood pc. added")
    27                    break
    28                elif order == "4":
    29                    break
    30        elif action == "2":
    31            print(menus)
    32        elif action == "3":
    33            print(my_cart)
    34            print(f"Total amount : {cost} $")
    35            while True:
    36                cart_edit = input("Do you want to cancel order? (Y/N): ")
    37                if cart_edit == "Y":
    38                    print("Which one would you like to cancel?")
    39                    remove_order = input("Please choose one [1] Hawaiian [2] Pepperoni [3] Seafood [4] Back :")
    40                    if remove_order == "1" and my_cart["Hawaiian pcs."] > 0:
    41                        my_cart["Hawaiian pcs."] -= 1
    42                        cost -= menus["Hawaiian $"]
    43                        print("Hawaiian pc. removed")
    44                        print(f"Current cart: {my_cart}, Total: {cost} $")
    45                        break
    46                    elif remove_order == "2" and my_cart["Pepperoni pcs."] > 0:
    47                        my_cart["Pepperoni pcs."] -= 1
    48                        cost -= menus["Pepperoni $"]
    49                        print("Pepperoni pc. removed")
    50                        print(f"Current cart: {my_cart}, Total: {cost} $")
    51                        break
    52                    elif remove_order == "3" and my_cart["Seafood pcs."] > 0:
    53                        my_cart["Seafood pcs."] -= 1
    54                        cost -= menus["Seafood $"]
    55                        print("Seafood pc. removed")
    56                        print(f"Current cart: {my_cart}, Total: {cost} $")
    57                        break
    58                    elif remove_order == "4":
    59                        break
    60                elif(cart_edit) == "N":
    61                    break
    62        elif action == "4":
    63            print("----------------------------------------")
    64            print("Receipt")
    65            print("----------------------------------------")
    66            print(f"Hawaiian pcs. : {my_cart['Hawaiian pcs.']}")
    67            print(f"Pepperoni pcs. : {my_cart['Pepperoni pcs.']}")
    68            print(f"Seafood pcs. : {my_cart['Seafood pcs.']}")
    69            print(f"Total amount : {cost}$")
    70            print("Thank you for ordering with us :)")
    71            print("Enjoy your Pizza and Have a good day!")
    72            break
    73        else:
    74            print("Error! You select the wrong option")
    75
    76bot_pizza()
    77# end of main.py
    
  • R Markdown Project

    R Markdown Project

    Let’s Go ! 😀

    Explore customer churn patterns using R with ggplot2, dplyr, and scales. Visualize key insights and learn how data-driven strategies can help reduce churn.