Home » Python

Python

Python 3: TypeError: unsupported format string passed to numpy.ndarray.__format__

This post explains how to work around a change in how Python string formatting works for numpy arrays between Python 2 and Python 3. I’ve been going through Kevin Markham‘s scikit-learn Jupyter notebooks and ran into a problem on the Cross Validation one, which was throwing this error when attempting to print the KFold example: Iteration Training set observations Testing ...

Read More »

NLP Tutorial Using Python NLTK (Simple Examples)

In this post, we will talk about natural language processing (NLP) using Python. This NLP tutorial will use Python NLTK library. NLTK is a popular Python library which is used for NLP. So what is NLP? and what are the benefits of learning NLP What is NLP? Simply and in short, natural language processing (NLP) is about developing applications and ...

Read More »

Using gRPC in Python

gRPC is an HTTP/2-based Remote Procedure Call (RPC) framework that uses protocol buffers (protobuf) as the underlying data serialization framework. It is an alternative to other language-neutral RPC frameworks such as Apache Thrift and Apache Arvo. In the first part of this series on using gRPC in Python, we will implement a gRPC service in Python. Our gRPC service will ...

Read More »

How to create a Google Drive App in Flask

This is the first in a series of articles for web programmers that explain in detail about using the Google Drive API in your web applications to access files/folders on behalf of the users of your application. In my last project, I had to develop a python flask app for my users that required to access the files stored in ...

Read More »

Flask Recipe – RESTful CRUD using sqlalchemy

RESTful apps are a thing these days. When your application’s userbase gets quite large and the client could vary from a laptop to an android device to an iOS device, it pays to keep the backend code separate and use the server only for making RESTful calls using HTTP methods that pertain to basic OLTP transactions: SELECT, INSERT, UPDATE and ...

Read More »

Capturing HTTP requests using BrowserMobProxy

1. BrowserMob Proxy Browsermob proxy is a developers utility that helps to monitor network traffic of a web application. It is a technology that is developed under the Selenium open source project. It is originally called andBrowser Mob is now a part of Neustar. A proxy is an (Apache 2.0 license) utility that can be used with Selenium or otherwise ...

Read More »

Python Built In Functions Example

Today we will be talking about some built-in functions in Python. Why are they important to know? Well, if you do import a lot of heavy libraries for simple tasks, that will be very inefficient. A good example of that is importing NumPy just to calculate the sum of elements in a row! So basically, built-in functions don’t need to ...

Read More »

Understanding Fixtures in PyTest

1. Introduction PyTest is used for developing automation tests using python. It is a very powerful framework that can be utilized to write effective test automation scenarios in python. PyTest framework makes it easy to write small tests, yet scalable, to support complex applications and libraries. 2. PyTest fixtures The purpose of test fixtures is to provide an inbuilt baseline ...

Read More »

Monitoring Your Asynchronous Python Web Applications Using Prometheus

In my last article, we saw how we can integrate the Prometheus monitoring system with synchronous Python applications. We focused on WSGI applications such as those written in Flask or Django and deployed using uwsgi or gunicorn. In this post, we will discuss integrating Prometheus with asynchronous web applications written using aiohttp, an HTTP client/server framework built upon asyncio. Software ...

Read More »