Tag: python

Linear Regression With Numpy

One of the simplest models of machine learning is linear regression When there is a linear relationship between the features and the target variable, all we need to find is the equation of the straight line in the multidimensional space For example, we have  real estate sales data: apartment size, floor, area code, distance from […]

Read more

Python Closure and Function Decorators

Python is a great programming language , you can write procedural, functional and object oriented code and develop almost anything. While writing code and using some infrastructures, you sometimes need to extend code without touching the original. The object oriented solution for that is inheritance but what if you are writing a procedural code? the […]

Read more

Porting Python 2 Code to Python 3

Python 3 was released in Dec 2008 – almost 10 years and we still found a lot of python 2.7 developers. Python 3 is Not backward compatible with Python 2. Most language features are the same,  some detail has changed and many deprecated features have been tided up and removed The main reason today to work with […]

Read more

Python – Exceptions and Error Handlings

If you write a complex python code , it is very important to handle errors and exceptions. While handling files, connecting to database systems and so on , you can be the best programmer in the world and still get errors that is not up to you. When you write a code for infrastructure, you […]

Read more

Python – Writing Functions – Complete Guide

Writing Python code is fun and easy. You can use Procedural programming, Functional programming , Object oriented programming or any combination.  Functions are basic unit in any method you choose. Functions are objects, defined with the ‘def’ statement followed by argument list. The function body is defined using indentation like other python statements def fn(a,b): […]

Read more

Python – Understanding Generators

Many functions in Python use or generate in-memory lists for iteration.  This is fine for relatively small list, but for large lists it becomes a problem. Lazy Lists A lazy list is when the next item is supplied when needed, and not before.  If we stop processing before reaching the end of the list then those […]

Read more

Python – Basics of Cryptography and API

Python is a great programming language for data analysis, web development, networking and more. While working with data , storing in files, sending to a remote machine and so on, we sometimes need to encrypt the data to prevent unauthorised access. With python cryptographic packages we can encrypt and decrypt data using various methods , […]

Read more

Deploying a New Python Package to Pypi

Python is a great programming language. The main reason python is so popular is the growing number of packages available to anyone. You can find those packages in many websites and in package managers. The official package manager for python is pypi , there are 2 versions – one for testing and one for production Lets […]

Read more

Interesting Python Standard Library Modules

Python developers use pypi to find packages. You need to search, filter some packages, read reviews from other developers, read the documentation and explore examples if exists. Anyone can build and deploy a package to pypi so you really don’t know if the package you found is working ok. Python standard library is full of […]

Read more

8 Python Modules For Files Handling

Python has input/output features which are very easy to use. Files are accessed through file objects and you can open, read, write and close files using a very simple and easy to use functions from the standard library. To manage files and deal with special file formats (xml, json..) python provides special packages that make the […]

Read more