Tuesday, 30 January 2024

Distance Measures in Data Science with Algorithms

Distance Measures in data science with algorithms

1. Euclidean Distance:

import numpy as np

def euclidean_distance(p1, p2):
    return np.sqrt(np.sum((p1 - p2) ** 2))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Euclidean distance:", euclidean_distance(point1, point2))

#clcoding.com
Euclidean distance: 2.8284271247461903


2. Manhattan Distance:

import numpy as np

def manhattan_distance(p1, p2):
    return np.sum(np.abs(p1 - p2))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Manhattan distance:", manhattan_distance(point1, point2))

#clcoding.com
Manhattan distance: 4



3. Cosine Similarity:

from scipy.spatial import distance

def cosine_similarity(p1, p2):
    return 1 - distance.cosine(p1, p2)

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Cosine similarity:", cosine_similarity(point1, point2))

#clcoding.com
Cosine similarity: 0.9838699100999074

4. Minkowski Distance:

import numpy as np

def minkowski_distance(p1, p2, r):
    return np.power(np.sum(np.power(np.abs(p1 - p2), r)), 1/r)

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Minkowski distance:", minkowski_distance(point1, point2, 3))

#clcoding.com
Minkowski distance: 2.5198420997897464



5. Chebyshev Distance:

import numpy as np

def chebyshev_distance(p1, p2):
    return np.max(np.abs(p1 - p2))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Chebyshev distance:", chebyshev_distance(point1, point2))

#clcoding.com
Chebyshev distance: 2


6. Hamming Distance:

import jellyfish

def hamming_distance(s1, s2):
    return jellyfish.hamming_distance(s1, s2)

# Example usage
string1 = "hello"
string2 = "hallo"
print("Hamming distance:", hamming_distance(string1, string2))

#clcoding.com
Hamming distance: 1



7. Jaccard Similarity:

def jaccard_similarity(s1, s2):
    set1 = set(s1)
    set2 = set(s2)
    intersection = set1.intersection(set2)
    union = set1.union(set2)
    return len(intersection) / len(union)

# Example usage
string1 = "hello"
string2 = "hallo"
print("Jaccard similarity:", jaccard_similarity(string1, string2))

#clcoding.com
Jaccard similarity: 0.6

8. Sørensen-Dice Index:

def sorensen_dice_index(s1, s2):
    set1 = set(s1)
    set2 = set(s2)
    intersection = set1.intersection(set2)
    return (2 * len(intersection)) / (len(set1) + len(set2))

# Example usage
string1 = "hello"
string2 = "hallo"
print("Sørensen-Dice index:", sorensen_dice_index(string1, string2))

#clcoding.com
Sørensen-Dice index: 0.75



9. Haversine Distance:

def haversine_distance(lat1, lon1, lat2, lon2):
    R = 6371.0  # Radius of the earth in km
    dLat = np.deg2rad(lat2 - lat1)
    dLon = np.deg2rad(lon2 - lon1)
    a = np.sin(dLat / 2)**2 + np.cos(np.deg2rad(lat1)) * np.cos(np.deg2rad(lat2)) * np.sin(dLon / 2)**2
    c = 2 * np.arctan2(np.sqrt(a), np.sqrt(1 - a))
    return R * c

# Example usage
print("Haversine distance:", haversine_distance(51.5074, 0.1278, 40.7128, -74.0060))

#clcoding.com
  Input In [14]
    a = np.sin(dLat / 2)**2 + np.cos(np.deg2rad(lat1)) *
                                                         ^
SyntaxError: invalid syntax

10. Mahalanobis Distance:

from scipy.spatial.distance import cdist

def mahalanobis_distance(X, Y):
    return cdist(X.reshape(1,-1), Y.reshape(1,-1), 'mahalanobis', VI=np.cov(X))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Mahalanobis distance:", mahalanobis_distance(point1, point2))

#clcoding.com
Mahalanobis distance: [[1.41421356]]



11. Pearson Correlation:

from scipy.stats import pearsonr

def pearson_correlation(X, Y):
    return pearsonr(X, Y)[0]

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Pearson correlation:", pearson_correlation(point1, point2))

#clcoding.com
Pearson correlation: 1.0

12. Squared Euclidean Distance:

def squared_euclidean_distance(X, Y):
    return euclidean_distance(X, Y)**2

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Squared Euclidean distance:", squared_euclidean_distance(point1, point2))

#clcoding.com
Squared Euclidean distance: 8.000000000000002



13. Jensen-Shannon Divergence:

def jensen_shannon_divergence(X, Y):
    M = 0.5 * (X + Y)
    return np.sqrt(0.5 * (rel_entr(X, M).sum() + rel_entr(Y, M).sum()))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Jensen-Shannon divergence:", jensen_shannon_divergence(point1, point2))

#clcoding.com
Jensen-Shannon divergence: 0.6569041853099059

14. Chi-Square Distance:

def chi_square_distance(X, Y):
    X = X / np.sum(X)
    Y = Y / np.sum(Y)
    return np.sum((X - Y) ** 2 / (X + Y))

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Chi-Square distance:", chi_square_distance(point1, point2))

#clcoding.com
Chi-Square distance: 0.01923076923076923



15. Spearman Correlation:

from scipy.stats import spearmanr

def spearman_correlation(X, Y):
    return spearmanr(X, Y)[0]

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Spearman correlation:", spearman_correlation(point1, point2))

#clcoding.com
Spearman correlation: 0.9999999999999999

16. Canberra Distance:

from scipy.spatial.distance import canberra

def canberra_distance(X, Y):
    return canberra(X, Y)

# Example usage
point1 = np.array([1, 2])
point2 = np.array([3, 4])
print("Canberra distance:", canberra_distance(point1, point2))

#clcoding.com
Canberra distance: 0.8333333333333333



Monday, 29 January 2024

Python Automation Cookbook: 75 Python automation ideas for web scraping, data wrangling, and processing Excel, reports, emails, and more, 2nd Edition

 


Get a firm grip on the core processes including browser automation, web scraping, Word, Excel, and GUI automation with Python 3.8 and higher

Key Features

Automate integral business processes such as report generation, email marketing, and lead generation

Explore automated code testing and Python’s growth in data science and AI automation in three new chapters

Understand techniques to extract information and generate appealing graphs, and reports with Matplotlib

Book Description

In this updated and extended version of Python Automation Cookbook, each chapter now comprises the newest recipes and is revised to align with Python 3.8 and higher. The book includes three new chapters that focus on using Python for test automation, machine learning projects, and for working with messy data.

This edition will enable you to develop a sharp understanding of the fundamentals required to automate business processes through real-world tasks, such as developing your first web scraping application, analyzing information to generate spreadsheet reports with graphs, and communicating with automatically generated emails.

Once you grasp the basics, you will acquire the practical knowledge to create stunning graphs and charts using Matplotlib, generate rich graphics with relevant information, automate marketing campaigns, build machine learning projects, and execute debugging techniques.

By the end of this book, you will be proficient in identifying monotonous tasks and resolving process inefficiencies to produce superior and reliable systems.

What you will learn

Learn data wrangling with Python and Pandas for your data science and AI projects

Automate tasks such as text classification, email filtering, and web scraping with Python

Use Matplotlib to generate a variety of stunning graphs, charts, and maps

Automate a range of report generation tasks, from sending SMS and email campaigns to creating templates, adding images in Word, and even encrypting PDFs

Master web scraping and web crawling of popular file formats and directories with tools like Beautiful Soup

Build cool projects such as a Telegram bot for your marketing campaign, a reader from a news RSS feed, and a machine learning model to classify emails to the correct department based on their content

Create fire-and-forget automation tasks by writing cron jobs, log files, and regexes with Python scripting

Who this book is for

Python Automation Cookbook - Second Edition is for developers, data enthusiasts or anyone who wants to automate monotonous manual tasks related to business processes such as finance, sales, and HR, among others. Working knowledge of Python is all you need to get started with this book.

Table of Contents

Let's Begin Our Automation Journey

Automating Tasks Made Easy

Building Your First Web Scraping Application

Searching and Reading Local Files

Generating Fantastic Reports

Fun with Spreadsheets

Cleaning and Processing Data

Developing Stunning Graphs

Dealing with Communication Channels

Why Not Automate Your Marketing Campaign?

Machine Learning for Automation

Automatic Testing Routines

Debugging Techniques

Hard Copy : Python Automation Cookbook: 75 Python automation ideas for web scraping, data wrangling, and processing Excel, reports, emails, and more, 2nd Edition

Hands-On Data Structures and Algorithms with Python: Store, manipulate, and access data effectively and boost the performance of your applications, 3rd Edition

 


Understand how implementing different data structures and algorithms intelligently can make your Python code and applications more maintainable and efficient

Key Features

Explore functional and reactive implementations of traditional and advanced data structures

Apply a diverse range of algorithms in your Python code

Implement the skills you have learned to maximize the performance of your applications

Book Description

Choosing the right data structure is pivotal to optimizing the performance and scalability of applications. This new edition of Hands-On Data Structures and Algorithms with Python will expand your understanding of key structures, including stacks, queues, and lists, and also show you how to apply priority queues and heaps in applications. You'll learn how to analyze and compare Python algorithms, and understand which algorithms should be used for a problem based on running time and computational complexity. You will also become confident organizing your code in a manageable, consistent, and scalable way, which will boost your productivity as a Python developer.

By the end of this Python book, you'll be able to manipulate the most important data structures and algorithms to more efficiently store, organize, and access data in your applications.

What you will learn

Understand common data structures and algorithms using examples, diagrams, and exercises

Explore how more complex structures, such as priority queues and heaps, can benefit your code

Implement searching, sorting, and selection algorithms on number and string sequences

Become confident with key string-matching algorithms

Understand algorithmic paradigms and apply dynamic programming techniques

Use asymptotic notation to analyze algorithm performance with regard to time and space complexities

Write powerful, robust code using the latest features of Python

Who this book is for

This book is for developers and programmers who are interested in learning about data structures and algorithms in Python to write complex, flexible programs. Basic Python programming knowledge is expected.

Table of Contents

Python Data Types and Structures

Introduction to Algorithm Design

Algorithm Design Techniques and Strategies

Linked Lists

Stacks and Queues

Trees

Heaps and Priority Queues

Hash Tables

Graphs and Algorithms

Searching

Sorting

Selection Algorithms

String Matching Algorithms

Appendix: Answers to the Questions

Hard Copy: Hands-On Data Structures and Algorithms with Python: Store, manipulate, and access data effectively and boost the performance of your applications, 3rd Edition

Mastering Python: Write powerful and efficient code using the full range of Python's capabilities, 2nd Edition

 


Use advanced features of Python to write high-quality, readable code and packages

Key Features

Extensively updated for Python 3.10 with new chapters on design patterns, scientific programming, machine learning, and interactive Python

Shape your scripts using key concepts like concurrency, performance optimization, asyncio, and multiprocessing

Learn how advanced Python features fit together to produce maintainable code

Book Description

Even if you find writing Python code easy, writing code that is efficient, maintainable, and reusable is not so straightforward. Many of Python's capabilities are underutilized even by more experienced programmers. Mastering Python, Second Edition, is an authoritative guide to understanding advanced Python programming so you can write the highest quality code. This new edition has been extensively revised and updated with exercises, four new chapters and updates up to Python 3.10.

Revisit important basics, including Pythonic style and syntax and functional programming. Avoid common mistakes made by programmers of all experience levels. Make smart decisions about the best testing and debugging tools to use, optimize your code's performance across multiple machines and Python versions, and deploy often-forgotten Python features to your advantage. Get fully up to speed with asyncio and stretch the language even further by accessing C functions with simple Python calls. Finally, turn your new-and-improved code into packages and share them with the wider Python community.

If you are a Python programmer wanting to improve your code quality and readability, this Python book will make you confident in writing high-quality scripts and taking on bigger challenges

What you will learn

Write beautiful Pythonic code and avoid common Python coding mistakes

Apply the power of decorators, generators, coroutines, and metaclasses

Use different testing systems like pytest, unittest, and doctest

Track and optimize application performance for both memory and CPU usage

Debug your applications with PDB, Werkzeug, and faulthandler

Improve your performance through asyncio, multiprocessing, and distributed computing

Explore popular libraries like Dask, NumPy, SciPy, pandas, TensorFlow, and scikit-learn

Extend Python's capabilities with C/C++ libraries and system calls

Who this book is for

This book will benefit more experienced Python programmers who wish to upskill, serving as a reference for best practices and some of the more intricate Python techniques. Even if you have been using Python for years, chances are that you haven't yet encountered every topic discussed in this book. A good understanding of Python programming is necessary

Table of Contents

Getting Started – One Environment per Project

Interactive Python Interpreters

Pythonic Syntax and Common Pitfalls

Pythonic Design Patterns

Functional Programming – Readability Versus Brevity

Decorators – Enabling Code Reuse by Decorating

Generators and Coroutines – Infinity, One Step at a Time

Metaclasses – Making Classes (Not Instances) Smarter

Documentation – How to Use Sphinx and reStructuredText

Testing and Logging – Preparing for Bugs

Debugging – Solving the Bugs

Performance – Tracking and Reducing Your Memory and CPU Usage

asyncio – Multithreading without Threads

Multiprocessing – When a Single CPU Core Is Not Enough

Scientific Python and Plotting

Artificial Intelligence

Extensions in C/C++, System Calls, and C/C++ Libraries

Packaging – Creating Your Own Libraries or Applications

Hard Copy : Mastering Python: Write powerful and efficient code using the full range of Python's capabilities, 2nd Edition

Learn Python Programming: An in-depth introduction to the fundamentals of Python, 3rd Edition

 


Get up and running with Python 3.9 through concise tutorials and practical projects in this fully updated third edition.

Purchase of the print or Kindle book includes a free eBook in PDF format.

Key Features

Extensively revised with richer examples, Python 3.9 syntax, and new chapters on APIs and packaging and distributing Python code

Discover how to think like a Python programmer

Learn the fundamentals of Python through real-world projects in API development, GUI programming, and data science

Book Description

Learn Python Programming, Third Edition is both a theoretical and practical introduction to Python, an extremely flexible and powerful programming language that can be applied to many disciplines. This book will make learning Python easy and give you a thorough understanding of the language. You'll learn how to write programs, build modern APIs, and work with data by using renowned Python data science libraries.

This revised edition covers the latest updates on API management, packaging applications, and testing. There is also broader coverage of context managers and an updated data science chapter.

The book empowers you to take ownership of writing your software and become independent in fetching the resources you need. You will have a clear idea of where to go and how to build on what you have learned from the book.

Through examples, the book explores a wide range of applications and concludes by building real-world Python projects based on the concepts you have learned.

What you will learn

Get Python up and running on Windows, Mac, and Linux

Write elegant, reusable, and efficient code in any situation

Avoid common pitfalls like duplication, complicated design, and over-engineering

Understand when to use the functional or object-oriented approach to programming

Build a simple API with FastAPI and program GUI applications with Tkinter

Get an initial overview of more complex topics such as data persistence and cryptography

Fetch, clean, and manipulate data, making efficient use of Python’s built-in data structures

Who this book is for

This book is for everyone who wants to learn Python from scratch, as well as experienced programmers looking for a reference book. Prior knowledge of basic programming concepts will help you follow along, but it’s not a prerequisite.

Table of Contents

A Gentle Introduction to Python

Built-In Data Types

Conditionals and Iteration

Functions, the Building Blocks of Code

Comprehensions and Generators

OOP, Decorators, and Iterators

Exceptions and Context Managers

Files and Data Persistence

Cryptography and Tokens

Testing

Debugging and Profiling

GUIs and Scripting

Data Science in Brief

Introduction to API Development

Packaging Python Applications

Hard Copy : Learn Python Programming: An in-depth introduction to the fundamentals of Python, 3rd Edition

Python Object-Oriented Programming: Build robust and maintainable object-oriented Python applications and libraries, 4th Edition

 


A comprehensive guide to exploring modern Python through data structures, design patterns, and effective object-oriented techniques

Key Features

Build an intuitive understanding of object-oriented design, from introductory to mature programs

Learn the ins and outs of Python syntax, libraries, and best practices

Examine a machine-learning case study at the end of each chapter

Book Description

Object-oriented programming (OOP) is a popular design paradigm in which data and behaviors are encapsulated in such a way that they can be manipulated together. Python Object-Oriented Programming, Fourth Edition dives deep into the various aspects of OOP, Python as an OOP language, common and advanced design patterns, and hands-on data manipulation and testing of more complex OOP systems. These concepts are consolidated by open-ended exercises, as well as a real-world case study at the end of every chapter, newly written for this edition. All example code is now compatible with Python 3.9+ syntax and has been updated with type hints for ease of learning.

Steven and Dusty provide a comprehensive, illustrative tour of important OOP concepts, such as inheritance, composition, and polymorphism, and explain how they work together with Python's classes and data structures to facilitate good design. In addition, the book also features an in-depth look at Python's exception handling and how functional programming intersects with OOP. Two very powerful automated testing systems, unittest and pytest, are introduced. The final chapter provides a detailed discussion of Python's concurrent programming ecosystem.

By the end of the book, you will have a thorough understanding of how to think about and apply object-oriented principles using Python syntax and be able to confidently create robust and reliable programs.

What you will learn

Implement objects in Python by creating classes and defining methods

Extend class functionality using inheritance

Use exceptions to handle unusual situations cleanly

Understand when to use object-oriented features, and more importantly, when not to use them

Discover several widely used design patterns and how they are implemented in Python

Uncover the simplicity of unit and integration testing and understand why they are so important

Learn to statically type check your dynamic code

Understand concurrency with asyncio and how it speeds up programs

Who this book is for

If you are new to object-oriented programming techniques, or if you have basic Python skills and wish to learn how and when to correctly apply OOP principles in Python, this is the book for you. Moreover, if you are an object-oriented programmer coming from other languages or seeking a leg up in the new world of Python, you will find this book a useful introduction to Python. Minimal previous experience with Python is necessary.

Table of Contents

Object-Oriented Design

Objects in Python

When Objects Are Alike

Expecting the Unexpected

When to Use Object-Oriented Programming

Abstract Base Classes and Operator Overloading

Python Data Structures

The Intersection of Object-Oriented and Functional Programming

Strings, Serialization, and File Paths

The Iterator Pattern

Common Design Patterns

Advanced Design Patterns

Testing Object-Oriented Programs

Concurrency

Hard Copy: Python Object-Oriented Programming: Build robust and maintainable object-oriented Python applications and libraries, 4th Edition

Sunday, 28 January 2024

Coding for Kids: Python: Learn to Code with 50 Awesome Games and Activities

 


Games and activities that teach kids ages 10+ to code with Python

Learning to code isn't as hard as it sounds—you just have to get started! Coding for Kids: Python starts kids off right with 50 fun, interactive activities that teach them the basics of the Python programming language. From learning the essential building blocks of programming to creating their very own games, kids will progress through unique lessons packed with helpful examples—and a little silliness!

Kids will follow along by starting to code (and debug their code) step by step, seeing the results of their coding in real time. Activities at the end of each chapter help test their new knowledge by combining multiple concepts. For young programmers who really want to show off their creativity, there are extra tricky challenges to tackle after each chapter. All kids need to get started is a computer and this book.

This beginner's guide to Python for kids includes:

50 Innovative exercises—Coding concepts come to life with game-based exercises for creating code blocks, drawing pictures using a prewritten module, and more.

Easy-to-follow guidance—New coders will be supported by thorough instructions, sample code, and explanations of new programming terms.

Engaging visual lessons—Colorful illustrations and screenshots for reference help capture kids' interest and keep lessons clear and simple.

Encourage kids to think independently and have fun learning an amazing new skill with this coding book for kids.

Hard Copy : Coding for Kids: Python: Learn to Code with 50 Awesome Games and Activities

Sprial Bound : Coding for Kids: Python: Learn to Code with 50 Awesome Games and Activities [Spiral-bound] Adrienne Tacke

PDF : Coding for Kids: Python: Learn to Code with 50 Awesome Games and Activities [Spiral-bound] Adrienne Tacke


Saturday, 27 January 2024

Image Processing in Python using Pillow


Image Processing in Python
#original Image

from PIL import Image
Image.open('clcodingmr.jpg')





1. Image Resizing:

from PIL import Image

def resize_image(image_path, output_path, width, height):
    image = Image.open(image_path)
    resized_image = image.resize((width, height))
    resized_image.save(output_path)

# Example usage:
resize_image('clcodingmr.jpg', 'resized_output.jpg', 300, 200)

# Now, open and show the resized image
Image.open('clcodingmr.jpg')
Image.open('resized_output.jpg')




2. Image Rotation with Pillow:

from PIL import Image
def rotate_image(image_path, output_path, angle):
    image = Image.open(image_path)
    rotated_image = image.rotate(angle)
    rotated_image.save(output_path)
# Example usage:
rotate_image('clcodingmr.jpg', 'rotated_output.jpg', 45)
Image.open('rotated_output.jpg')




3. Image Translation (using crop) with Pillow:

from PIL import Image
def translate_image(image_path, output_path, tx, ty):
    image = Image.open(image_path)
    translated_image = image.crop((tx, ty, image.width, image.height))
    translated_image.save(output_path)
# Example usage:
translate_image('clcodingmr.jpg', 'translated_output.jpg', 50, 30)
Image.open('translated_output.jpg')




4. Image Shearing (using affine transform) with Pillow:
Image.open('sheared_output.jpg')
from PIL import Image, ImageOps
def shear_image(image_path, output_path, shear_factor):
    image = Image.open(image_path)
    shear_matrix = [1, shear_factor, 0, 0, 1, 0]
    sheared_image = image.transform(image.size, Image.AFFINE, shear_matrix)
    sheared_image.save(output_path)
# Example usage:
shear_image('clcodingmr.jpg', 'sheared_output.jpg', 0.2)
Image.open('sheared_output.jpg')




5. Image Normalization (simple contrast adjustment) with Pillow:

from PIL import Image
def normalize_image(image_path, output_path):
    image = Image.open(image_path)
    normalized_image = ImageOps.autocontrast(image)
    normalized_image.save(output_path)
# Example usage:
normalize_image('clcodingmr.jpg', 'normalized_output.jpg')
Image.open('normalized_output.jpg')




6. Image Blurring (using a filter) with Pillow:

from PIL import Image, ImageFilter
def blur_image(image_path, output_path, radius):
    image = Image.open(image_path)
    blurred_image = image.filter(ImageFilter.GaussianBlur(radius))
    blurred_image.save(output_path)
# Example usage:
blur_image('clcodingmr.jpg', 'blurred_output.jpg', 5)
Image.open('blurred_output.jpg')




Google Project Management: Professional Certificate

 


What you'll learn

Gain an immersive understanding of the practices and skills needed to succeed in an entry-level project management role

Learn how to create effective project documentation and artifacts throughout the various phases of a project

Learn the foundations of Agile project management, with a focus on implementing Scrum events, building Scrum artifacts, and understanding Scrum roles

Practice strategic communication, problem-solving, and stakeholder management through real-world scenarios

Join Free: 

Professional Certificate - 6 course series

Prepare for a new career in the high-growth field of project management, no experience required. Get professional training designed by Google and get on the fastrack to a competitively paid job.

Project managers are natural problem-solvers. They set the plan and guide teammates, and manage changes, risks, and stakeholders.

Over 6 courses, gain in-demand skills that will prepare you for an entry-level job. Learn from Google employees whose foundations in project management served as launchpads for their own careers. At under 10 hours per week, you can complete in less than six months.

This program qualifies you for over 100 hours of project management education, which helps prepare you for 
Project Management Institute
 Certifications like the globally-recognized 
Certified Associate in Project Management (CAPM)®

Join FREE : Google Project Management: Professional Certificate


Applied Learning Project

This program includes over 140 hours of instruction and hundreds of practice-based assessments which will help you simulate real-world project management scenarios that are critical for success in the workplace.

The content is highly interactive and exclusively developed by Google employees with decades of experience in program and project management.

Skills you’ll gain will include: Creating risk management plans; Understanding process improvement techniques; Managing escalations, team dynamics, and stakeholders; Creating budgets and navigating procurement; Utilizing  project management software, tools, and templates; Practicing Agile project management, with an emphasis on Scrum.

Through a mix of videos, assessments, and hands-on activities, you’ll get introduced to initiating, planning, and running both traditional and Agile projects. You’ll develop a toolbox to demonstrate your understanding of key project management elements, including managing a schedule, budget, and team.

10 different data charts using Python

 # 10 different data charts using Python


pip install matplotlib seaborn

# 1. Line Chart:

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y = [10, 12, 5, 8, 3]

plt.plot(x, y)
plt.title('Line Chart')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.show()
#clcoding.com




# 2. Bar Chart:

import matplotlib.pyplot as plt

categories = ['A', 'B', 'C', 'D']
values = [25, 40, 30, 20]

plt.bar(categories, values)
plt.title('Bar Chart')
plt.xlabel('Categories')
plt.ylabel('Values')
plt.show()
#clcoding.com




# 3. Pie Chart:

import matplotlib.pyplot as plt

labels = ['Category A', 'Category B', 'Category C']
sizes = [30, 45, 25]

plt.pie(sizes, labels=labels, autopct='%1.1f%%')
plt.title('Pie Chart')
plt.show()
#clcoding.com




# 4. Histogram:

import matplotlib.pyplot as plt
import numpy as np

data = np.random.randn(1000)

plt.hist(data, bins=30, edgecolor='black')
plt.title('Histogram')
plt.xlabel('Values')
plt.ylabel('Frequency')
plt.show()
#clcoding.com




# 5. Scatter Plot:

import matplotlib.pyplot as plt
import numpy as np

x = np.random.rand(50)
y = 2 * x + 1 + 0.1 * np.random.randn(50)

plt.scatter(x, y)
plt.title('Scatter Plot')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.show()
#clcoding.com




# 6. Box Plot:

import seaborn as sns
import numpy as np

data = [np.random.normal(0, std, 100) for std in range(1, 4)]

sns.boxplot(data=data)
plt.title('Box Plot')
plt.xlabel('Category')
plt.ylabel('Values')
plt.show()
#clcoding.com




# 7. Violin Plot:

import seaborn as sns
import numpy as np

data = [np.random.normal(0, std, 100) for std in range(1, 4)]

sns.violinplot(data=data)
plt.title('Violin Plot')
plt.xlabel('Category')
plt.ylabel('Values')
plt.show()
#clcoding.com




# 8. Heatmap:

import seaborn as sns
import numpy as np

data = np.random.rand(10, 10)

sns.heatmap(data, annot=True)
plt.title('Heatmap')
plt.show()
#clcoding.com




# 9. Area Chart:

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y1 = [10, 15, 25, 30, 35]
y2 = [5, 10, 20, 25, 30]

plt.fill_between(x, y1, y2, color='skyblue', alpha=0.4)
plt.title('Area Chart')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.show()
#clcoding.com




# 10. Radar Chart:

import matplotlib.pyplot as plt
import numpy as np

labels = np.array([' A', ' B', ' C', ' D', ' E'])
data = np.array([4, 5, 3, 4, 2])

angles = np.linspace(0, 2 * np.pi, len(labels), endpoint=False)
data = np.concatenate((data, [data[0]]))
angles = np.concatenate((angles, [angles[0]]))

plt.polar(angles, data, marker='o')
plt.fill(angles, data, alpha=0.25)
plt.title('Radar Chart')
plt.show()
#clcoding.com




Friday, 26 January 2024

Build Your Own Programming Language: A programmer's guide to designing compilers, DSLs and interpreters for solving modern computing problems, 2nd Edition

 


Written by the creator of the Unicon programming language, this book will show you how to implement programming languages to reduce the time and cost of creating applications for new or specialized areas of computing.

Key Features

  • Solve pain points in your application domain by building a custom programming language
  • Learn how to create parsers, code generators, semantic analyzers, and interpreters
  • Target bytecode, native code, and preprocess or transpile code into another high level language

Book Description

The need for different types of computer languages is growing, as is the need for domain-specific languages. Building your own programming language has its advantages, as it can be your antidote to the ever-increasing complexity of software.

In this book, you'll start with implementing the frontend of a compiler for your language, including a lexical analyzer and parser, including the handling of parse errors. The book then covers a series of traversals of syntax trees, culminating with code generation for a bytecode virtual machine or native code. You’ll also manage data structures and output code when writing a preprocessor or a transpiler.

Moving ahead, you'll learn how domain-specific language features are often best represented by operators and functions that are built into the language, rather than library functions. We'll conclude with how to implement garbage collection. Throughout the book, Dr. Jeffery weaves in his experience from building the Unicon programming language to give better context to the concepts. Relevant examples are provided in Unicorn and Java so that you can follow the code of your choice. In this edition, code examples have been extended and further tested.

By the end of this book, you'll be able to build and deploy your own domain-specific languages, capable of compiling and running programs.

What you will learn

  • Perform requirements analysis for the new language and design language syntax and semantics
  • Write lexical and context-free grammar rules for common expressions and control structures
  • Develop a scanner that reads source code and generate a parser that checks syntax
  • Build key data structures in a compiler and use your compiler to build a syntax-coloring code editor
  • Write tree traversals that insert information into the syntax tree
  • Implement a bytecode interpreter and run bytecode generated by your compiler
  • Write native code and run it after assembling and linking using system tools
  • Preprocess and transpile code from your language into another high level language
  • Implement garbage collection in your language

Who This Book Is For

This book is for software developers interested in the idea of inventing their own language or developing a domain-specific language. Computer science students taking compiler construction courses will also find this book highly useful as a practical guide to language implementation to supplement more theoretical textbooks. We assume most readers will have intermediate or better proficiency in a high level programming language such as Java or C++.

Table of Contents

  1. Why Build Another Programming Language?
  2. Programming Language Design
  3. Scanning Source Code
  4. Parsing
  5. Syntax Trees
  6. Symbol Tables
  7. Checking Base Types
  8. Checking Types on Function Calls and Structure Accesses
  9. Intermediate Code Generation
  10. Syntax Coloring in an IDE
  11. Preprocessors and Transpilers
  12. Bytecode Interpreters
  13. Generating Bytecode
  14. Native Code Generation
  15. Built in Operators and Functions
  16. Control Structures   

Hard Copy : Build Your Own Programming Language: A programmer's guide to designing compilers, DSLs and interpreters for solving modern computing problems, 2nd Edition



How much do you know about functional programming in Python?

 


a. lambda function cannot be used with reduce( ) function.

Answer

False

b. lambda, map( ), filter( ), reduce( ) can be combined in one single

expression.

Answer

True

c. Though functions can be assigned to variables, they cannot be called

using these variables.

Program

False

d. Functions can be passed as arguments to function and returned from

function.

Program

True

e. Functions can be built at execution time, the way lists, tuples, etc. can

be.

Program

True

f. Lambda functions are always nameless.

Program

True

Thursday, 25 January 2024

DevOps on AWS: Release and Deploy

 


Build your subject-matter expertise

This course is part of the DevOps on AWS Specialization

When you enroll in this course, you'll also be enrolled in this Specialization.

Learn new concepts from industry experts

Gain a foundational understanding of a subject or tool

Develop job-relevant skills with hands-on projects

Earn a shareable career certificate

Join Free: DevOps on AWS: Release and Deploy

There are 2 modules in this course

AWS provides a set of flexible services designed to enable companies to more rapidly and reliably build and deliver products using AWS and DevOps practices. These services simplify provisioning and managing infrastructure, deploying application code, automating software release processes, and monitoring your application and infrastructure performance. 

The third course in the series explains how to improve the deployment process with DevOps methodology, and also some tools that might make deployments easier, such as Infrastructure as Code, or IaC, and AWS CodeDeploy.

The course begins with reviewing topics covered in the first course of the DevOps on AWS series. You will learn about the differences between continuous integration, continuous delivery, and continuous deployment. In Exercises 1 and 2, you will set up AWS CodeDeploy and make revisions that will then be deployed. If you use AWS Lambda, you will explore ways to address additional considerations when you deploy updates to your Lambda functions.

Next, you will explore how infrastructure as code (IaC) helps organizations achieve automation, and which AWS solutions provide a DevOps-focused way of creating and maintaining infrastructure. In Exercise 3, you will be provided with an AWS CloudFormation template that will set up backend services, such as AWS CodePipeline, AWS CodeCommit, AWS CodeDeploy, and AWS CodeBuild. You will then upload new revisions to the pipeline.

DevOps on AWS: Operate and Monitor

 


Build your subject-matter expertise

This course is part of the DevOps on AWS Specialization

When you enroll in this course, you'll also be enrolled in this Specialization.

Learn new concepts from industry experts

Gain a foundational understanding of a subject or tool

Develop job-relevant skills with hands-on projects

Earn a shareable career certificate

Join Free: DevOps on AWS: Operate and Monitor

There are 2 modules in this course

The third and the final course in the DevOps series will teach how to use AWS Services to control the architecture in order to reach a better operational state. Monitoring and Operation are key aspects for both the release pipeline and production environments, because they provide instruments that help discover what's happening, as well as do modifications and enhancements on infrastructure that is currently running. 

This course teaches how to use Amazon CloudWatch for monitoring, as well as Amazon EventBridge and AWS Config for continuous compliance. It also covers Amazon CloudTrail and a little bit of Machine Learning for Monitoring operations!

Exam Prep: AWS Certified Cloud Practitioner Foundations

 


What you'll learn

The four domains - Cloud Concepts, Security and Compliance, Technology and Billing and Pricing - for the AWS Certified Cloud Practitioner exam

Certification exam-level practice questions written by experts from AWS

Simulations designed to solidify understanding of cloud concepts you need to know for the exam

Join Free: Exam Prep: AWS Certified Cloud Practitioner Foundations

There are 4 modules in this course

This new foundational-level course from Amazon Web Services (AWS), is designed to help you to assess your preparedness for the AWS Certified Cloud Practitioner certification exam.  You will learn how to prepare for the exam by exploring the exam’s topic areas and how they map to both AWS Cloud practitioner roles and to specific areas of study. You will review sample certification questions in each domain, practice skills with hands-on exercises, test your knowledge with practice question sets, and learn strategies for identifying incorrect responses by interpreting the concepts that are being tested in the exam. At the end of this course you will have all the knowledge and tools to help you identity your strengths and weaknesses in each certification domain areas that are being tested on the certification exam. 

The AWS Certified Cloud Foundations Certification the AWS Certified Cloud Practitioner (CLF-C01) exam is intended for individuals who can effectively demonstrate an overall knowledge of the AWS Cloud independent of a specific job role. The exam validates a candidate’s ability to complete the following tasks: Explain the value of the AWS Cloud, Understand and explain the AWS shared responsibility model, understand security best practices, Understand AWS Cloud costs, economics, and billing practices, Describe and position the core AWS services, including compute, network, databases, and storage and identify AWS services for common use cases

Popular Posts

Categories

100 Python Programs for Beginner (118) AI (152) Android (25) AngularJS (1) Api (6) Assembly Language (2) aws (27) Azure (8) BI (10) Books (251) Bootcamp (1) C (78) C# (12) C++ (83) Course (84) Coursera (298) Cybersecurity (28) Data Analysis (24) Data Analytics (16) data management (15) Data Science (217) Data Strucures (13) Deep Learning (68) Django (16) Downloads (3) edx (21) Engineering (15) Euron (30) Events (7) Excel (17) Finance (9) flask (3) flutter (1) FPL (17) Generative AI (47) Git (6) Google (47) Hadoop (3) HTML Quiz (1) HTML&CSS (48) IBM (41) IoT (3) IS (25) Java (99) Leet Code (4) Machine Learning (186) Meta (24) MICHIGAN (5) microsoft (9) Nvidia (8) Pandas (11) PHP (20) Projects (32) Python (1218) Python Coding Challenge (884) Python Quiz (342) Python Tips (5) Questions (2) R (72) React (7) Scripting (3) security (4) Selenium Webdriver (4) Software (19) SQL (45) Udemy (17) UX Research (1) web application (11) Web development (7) web scraping (3)

Followers

Python Coding for Kids ( Free Demo for Everyone)