Category: Python

Python code examples

Python – The birthday paradox algorithm

The birthday paradox is an interesting problem, mainly because of its somehow “unexpected” results. The problem usually is stated as the following: What is the minimum number of people in a room, in order to have a probability higher than

Tagged with: , , ,

Sets in Python – Differece, Symetric Difference, Union, Intersection

After writing the article scraping a web site up to the N-th level with Python, I have decided to summarize what could be achieved with Set() in this language. Pretty much, sets can be described as lists with a few

Tagged with: , , , ,

Numpy and Pandas – Small introduction with Jupyter Notebook

Last week I was participating at the Python and ML Summit in Berlin. One of the most interesting lectures, on which I participated, was a workshop by, named “Reading all yourself was yesterday – How to turn large amounts of

Tagged with: , , , , ,

Python and MachineLearning Summit in Berlin – Summary

This Monday and Tuesday (14. – 15. October 2019) I was in Berlin, participating at the #Python and #ML Summit. Actually, #Berlin is a nice city, one of my favourites in Germany, thus if you are not from there, only

Tagged with: , , , ,

Python – Stand Alone Application with GUI

Python has a built-in GUI package, which allows easy building of forms like this: The package used in this example is tkinter. The form above takes the value, entered in the entry field, squares it and displays it back in

Tagged with: , , , ,

Analyzing trends with map and reduce in Python

Editorial (from Vitosh): Lately, I have reviewed the Mastering Large Datasets book by J.T. Wolohan. The book is python based and it explains how to scale a data project, using the map and reduce to scale data projects. Long story

Tagged with: , , , ,

Python – Customizing PyLab using Style

Learn how to customize PyLab using style in this article by Benjamin Walter Keller, a PhD candidate at McMaster University with BSc in physics with a minor in computer science from the University of Calgary in 2011. This article will delve

Tagged with: , , , ,

Python – Plotting with Object-Oriented API

Learn how to plot a correlation matrix using pyplot and object-oriented APIs in this article by Srinivasa Rao Poladi, the co-founder of krtrimaIQ a consulting firm that provides cognitive solutions to create tomorrow’s Intelligent Enterprises powered by automation, big data,

Tagged with: ,

Fundamental Concepts of Concurrent Programming with Python

Learn some of the fundamental concepts of concurrent programming in this article by Quan Nguyen, a Python enthusiast and data scientist. It is estimated that the amount of data that needs to be processed by computer programs doubles every two years. The International Data Corporation (IDC), for

Tagged with: ,

Python – Balancing CartPole with Machine Learning

This article will show you how to solve the CartPole balancing problem. The CartPole is an inverted pendulum, where the pole is balanced against gravity. Traditionally, this problem is solved by control theory, using analytical equations. However, in this article, you’lllearn to solve the

Tagged with: ,

NumPy Fast Operation and Computations

LearnNumPy fast operation and computations in this article by Alberto Boschetti, a data scientist with expertise in signal processing and statistics and Luca Massaron, a data scientist and marketing research director specialized in multivariate statistical analysis, machine learning, and customer

Tagged with: , ,

Build, Test, and Deploy with Zappa

Learn how to build, test, and deploy a Python web service using Zappa in this article by Abdulwahid Abdulhaque Barguzar, a software architect and an active contributor to the open source community. He has developed a deep understanding of architecting

Tagged with: , , , ,

Using NumPy for Simulations

Learn how to use NumPy for simulations in this tutorial by Alvaro Fuentes, a data scientist with an M.S. in quantitative economics and applied mathematics with more than 10 years of experience in analytical roles. NumPy, also known as Python’s vectorization solution,

Tagged with: , , , ,

Hashing Passwords in Python

ModernPythonStandardLibraryBook

Learn how passwords can be stored without a risk of leaking them in this tutorial by Alessandro Molina, a Python developer since 2001 and currently the core developer of the TurboGears2 web framework and maintainer of Beaker Caching/Session framework.While cryptography is

Tagged with: , , ,

Python – Write Values in all Worksheets of existing Excel File

Working with VBA is usually not considered high level of programming. Still, when it comes to Excel, this is probably the best solution. However, Python has some libraries which can help a bit, if you are willing to “mimic” the

Tagged with: , ,

Run Python Functions From Excel With VBA with Shell through CommandPrompt

Selecting Python for a “weapon” of choice has many positive points, which I am not going to describe now. Still, if you want to run python code with the help of VBA and the Shell through the CommandPrompt of Windows,

Tagged with: , , ,

How to Search In Excel Worksheet with Python

Working with Python and Excel together is really fun for a VBA Developer! It somehow shows you what all these years of coding with VBA have taught you! Today, I was thinking how to implement the .Find() method of searching in

Tagged with: , , ,

Python – Simple writing in Excel with XlsWriter

The XlsxWriter library of Python is a nice gem for a VBA developer – you would be really interested to see the problems a Python developer should be facing, just to achieve a simple part Excel automatization. Still, these are

Tagged with: , ,

DevOps Conference in coming – time to install Python on my machine

In less than 4 days I would be travelling to Berlin to see what is happening on the DevOpsCon there. I will be present for a whole day workshop for machine learning with Python, thus I have decided that it

Tagged with: , ,

Book Review – Python Algorithms

Some month ago, I have kindly received two books from Apress.com for a review. The first one was for Python Data Analytics, which I have already reviewed and the second once was Python Algorithms. Before starting the review, let me

Tagged with:

Book Review – Python Data Analytics – Coming soon

A new book review is coming in the next weeks – I have noticed the Python books of Apress some time ago and today I was provided with a paper copy for a review.   The review is yet to come!

Tagged with: ,

Python – Algorithm from CodeForces – Bears and Blocks

Hello party people! 🙂 Today I was wondering whether I have forgotten to code in Python after 4 weeks of coding marathon in VBA and I have decided to try a small portion of the weekly challenge from CodeForces! So, the

Tagged with: , , ,

Python – Algorithm – Calculate Average distance with Dijkstra

In the current article I will try to solve a problem for calculation of average distance with Dijkstra, given in codeforces.com contest here in pdf. What is the problem like? We have n weighted graphs like this: For each given graph,

Tagged with: , ,

Python Algorithms – Maximum combinations of coins

Sometimes complicated algorithms are really easy to be written down. The current problem is solved in 6 lines of code (from line 5 to line 11), but it you need to put effort to understand how the algorithm works and what are

Tagged with: , ,

Python Algorithms – Full Dijkstra is stunning again

Yesterday I have spent some hours, trying to resolve one problem for shortest paths. The problem was coming from HackBulgaria and was somehow similar to these two problems here: Get the shortest path in a weighted graph with Dijkstra Dijkstra for

Tagged with: , , , ,

Python – Calculating words in matrix – contest problem

Today I was looking into the following problem for word counter in python from Hack Bulgaria: You are given a rectangular table filled with characters and a word. Your task is to count the occurrences of the word in the

Tagged with: , , ,

Python – Dijkstra algorithm for all nodes

In this article I will present the solution of a problem for finding the shortest path on a weighted graph, using the Dijkstra algorithm for all nodes. The problem is formulated by HackBulgaria here. Pretty much, you are given a

Tagged with: , , ,

Python – Usage of a Binary Tree with List in Python

After the article here, concerning the building of the binary trees and their usefulness, today I will show how to use these trees in action 🙂 Imagine that we have the following problem, used in arena.hackbulgaria.com: Implement a program in

Tagged with: , , , ,

Python – Build a binary tree list in python

Binary trees are really useful, if you are solving an algorithmic problem. They consists of nodes (a.k.a vertices) and edges. Thus, each node has two edges, which are leading to another node. Something like this: The above tree is a simple random non-balanced

Tagged with: , ,

Python – Algorithm Challenge – First Day At School

Yesterday, I have started to solve problems from a challenging Russian site for programming competitions. Today, I have decided to spend about 30 minutes on another problem, which seemed easy, but I am already spending hours on it, without being able

Tagged with: , ,
Top