Python Wrangler Part 2

Posted: October 23, 2018 in Programming
Tags: ,

Part 2 of my Collection Exodus from Google+.  My links to tutorials, info, references and interesting stuff.

As the name suggests it only deals with Python; though due to Python libraries you find it creeps into other Programming Language realms (eg: cython).

CONTENT

  1. Python Binary To Decimal Tutorial With Examples
  2. Concise Cheat Sheets for Machine Learning with Python (and Maths)
  3. Python Pandas read_excel to Import Excel File Into DataFrame
  4. Pandas read_csv Examples for Importing Files
  5. PYTHON GAME : MINESWEEPER
  6. Write a function which takes no input……
  7. Python Sort Dictionary By Value – Sort With Lambda Function And Operator Module
  8. Using ipdb with Python 3.7.x breakpoint
  9. A Simple Guide for Python Packaging
  10. Hiding a payload in PNG files with Python
  11. 20 Python libraries you aren’t using (but should)
  12. Face Recognition with Python, in Under 25 Lines of Code
  13. How To Copy A File In Python – 9 Different Ways To Do It!
  14. Python-mode – A Vim Plugin to Develop Python Applications in Vim Editor
  15. Reviewing Python Basics and Creating Your First Web Application with Django – Part 2
  16. Learn how to program in Python by building a simple dice game
  17. Python and speed (or: acceleration is easy)
  18. A collection of surprising Python snippets and lesser-known features.
  19. Automate the Boring Stuff with Python
  20. How to Write Python Unit Tests
  21. What Features Make Python a Great Programming Language
  22. Working with strings in Python
  23. How to Sum Elements of Two Lists in Python
  24. The definitive guide to Python exceptions
  25. Understanding functions global variables and local variables in python programming
  26. How to access/view Python help when using vim
  27. Python Programming Examples
  28. Cython: fast as GPUs without GPUs
  29. Python : How to Remove Duplicates from a List
  30. Parallelism in one line

———————————–o0o———————————–

1. Python Binary To Decimal Tutorial With Examples

In this Python Binary To Decimal post we will talk about some basics of number system and how to convert binary numbers into decimal numbers. But before doing this we will have to understand some basic concepts of binary number system. So let’s start.

Normally when we work in programming world, we work with binary system as well as with decimal system. So in the programming world we use binary system and decimal system but apart from this we have two more system which are octal and hexadecimal system. Now when do we use all these stuffs ? In physical address 88-78-73-9E-74-38, the number is defined in hexadecimal number, same goes to IPv6 3ffe:1900:4545:3:200:f8ff:fe21:67cf. ,which is defined in hexadecimal numbers. In our computer we use binary format and in normal system we use decimal system. So let’s understand how can we convert these values system to another values system.

https://www.simplifiedpython.net/python-binary-to-decimal/

———————————–o0o———————————–

2. Concise Cheat Sheets for Machine Learning with Python (and Maths)

Machine learning is difficult for beginners. As well as libraries for Machine Learning in python are difficult to understand. Over the past few weeks, I have been collecting Machine Learning cheat sheets from different sources and to make things more interesting and give context, I added excerpts for each major topic.

If you are just getting started with Machine Learning or Data Science, you’ll richly benefit from resources compiled from our recent publications;

https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/

———————————–o0o———————————–

3. Python Pandas read_excel to Import Excel File Into DataFrame

The Python Pandas read_excel function lets you import data from Excel files into a Pandas DataFrame. This tutorial includes several Pandas read_excel examples to teach you how to properly use the function to read Excel files in Python Pandas. It’s closely related to our article about the Pandas read_csv function, but this tutorial focuses exclusively on reading Excel files.

https://wellsr.com/python/python-pandas-read_excel-to-import-excel-file-into-dataframe/

———————————–o0o———————————–

4. Pandas read_csv Examples for Importing Files

The Pandas read_csv function lets you import data from CSV and plain-text files into DataFrames. This tutorial provides several Pandas read_csv examples to teach you how the function works and how you can use it to import your own files. If you’re looking for how to read Excel files with Pandas, I encourage you to read our tutorial about the read_excel function.

https://wellsr.com/python/pandas-read_csv-examples-for-importing-files/

———————————–o0o———————————–

5. PYTHON GAME : MINESWEEPER

So for now, we are going to create a simple Minesweeper game using Python 3.

Do not copy paste the code as it lacks indentation error, instead download the .py file from below are run directly.

https://techtalksonline.wordpress.com/2018/10/19/python-game-minesweeper/

———————————–o0o———————————–

6. Write a function which takes no input…..

Write a function which takes no input. It initializes a dataframe with 2 columns – ‘alphabet’ and ‘number’ which has 26 rows (alphabet column has values ‘a’, ‘b’, … ‘z’ and number column has values 1, 2, … 26). Now return a dataframe with only those rows where the number column has value divisible by 5.

http://programmingbyrajat.blogspot.com/2018/10/write-function-which-takes-no-input-it.html

———————————–o0o———————————–

7. Python Sort Dictionary By Value – Sort With Lambda Function And Operator Module

Hi everyone, in Python Sort Dictionary By Value tutorial, we will learn how can we sort dictionary by value. We will also learn about what is dictionary, how to create it, and many more. So let’s gets start to explore the a powerful concept of python i.e., dictionary.

All of you have heard about dictionary that helps you finding meaning of words(In any human language ) but now its time to discuss about dictionary of programming language. And dictionary is a powerful data structure in python. So in this tutorial we will see how can we deal with python dictionaries.

https://www.simplifiedpython.net/python-sort-dictionary-by-value/

———————————–o0o———————————–

8. Using ipdb with Python 3.7.x breakpoint

Python 3.7.x introduced a new method to insert a breakpoint in the code. Before Python 3.7.x to insert a debugging point we had to write import pdb; pdb.set_trace() which honestly I could never remember (and I also created a snippet on VS Code to auto complete it).

Now you can just write breakpoint() that’s it!

https://www.andreagrandi.it/2018/10/16/using-ipdb-with-python-37-breakpoint/

———————————–o0o———————————–

9. A Simple Guide for Python Packaging

Code reuse is a very common need. It saves you time for writing the same code multiple times, enables leveraging other smart people’s work to make new things happen. Even just for one project, it helps organize code in a modular way so you can maintain each part separately. When it comes to python, it means format your project so it can be easily packaged. This is a simple instruction on how to go from nothing to a package that you can proudly put it in your portfolio to be used by other people.

https://medium.com/small-things-about-python/lets-talk-about-python-packaging-6d84b81f1bb5

———————————–o0o———————————–

10. Hiding a payload in PNG files with Python

“I show you how you can use the PNG spec to your advantage to store arbitrary data on websites like Reddit.”

http://blog.brian.jp/python/png/2016/07/07/file-fun-with-pyhon.html

———————————–o0o———————————–

11. 20 Python libraries you aren’t using (but should)

Discover lesser-known Python libraries that are easy to install and use, cross-platform, and applicable to more than one domain.

https://www.oreilly.com/learning/20-python-libraries-you-arent-using-but-should

———————————–o0o———————————–

12. Face Recognition with Python, in Under 25 Lines of Code

In this article, we’ll look at a surprisingly simple way to get started with face recognition using Python and the open source library OpenCV.

https://realpython.com/face-recognition-with-python/

———————————–o0o———————————–

13. How To Copy A File In Python – 9 Different Ways To Do It!

Python comes with many out of the box modules (like os, subprocess, and shutil) to support File I/O operations. And in this post, you’ll get to see some unique ways to copy a file in Python. So, let’s get started to learn the nine different methods to do Python copy file operation.

https://www.techbeamers.com/python-copy-file/

———————————–o0o———————————–

14. Python-mode – A Vim Plugin to Develop Python Applications in Vim Editor

Python-mode is a vim plugin that enables you to write Python code in Vim editor in a fast manner by utilizing libraries including pylint, rope, pydoc, pyflakes, pep8, autopep8, pep257 and mccabe for coding features such as static analysis, refactoring, folding, completion, documentation, and more.

https://www.tecmint.com/python-mode-a-vim-editor-plugin/

———————————–o0o———————————–

15. Reviewing Python Basics and Creating Your First Web Application with Django – Part 2

As we briefly commented on the last article of this series, Django is a free and open source web framework that turns application development into a faster task done in a more effective way – from the programmer’s point of view.

https://www.tecmint.com/python-overview-and-creating-web-application-project-with-django/

———————————–o0o———————————–

16. Learn how to program in Python by building a simple dice game

Python is an all-purpose programming language that can be used to create desktop applications, 3D graphics, video games, and even websites. It’s a great first programming language because it can be easy to learn and it’s simpler than complex languages like C, C++, or Java. Even so, Python is powerful and robust enough to create advanced applications, and it’s used in just about every industry that uses computers. This makes Python a good language for young and old, with or without any programming experience.

https://opensource.com/article/17/10/python-101

———————————–o0o———————————–

17. Python and speed (or: acceleration is easy)

t’s like “Python is slow”. Apart from the fact that such blanket statements are generally questionable, the statement is a crucial mistake: Python describes the (programming) language itself – but there are several implementations that sometimes differ significantly in terms of speed.

https://noisefloor-net.blogspot.com/2018/01/python-und-geschwindigkeit-oder.html

———————————–o0o———————————–

18. A collection of surprising Python snippets and lesser-known features.

Python, being a beautifully designed high-level and interpreter-based programming language, provides us with many features for the programmer’s comfort. But sometimes, the outcomes of a Python snippet may not seem obvious to a regular user at first sight.

Here is a fun project to collect such tricky & counter-intuitive examples and lesser-known features in Python, attempting to discuss what exactly is happening under the hood!

While some of the examples you see below may not be WTFs in the truest sense, but they’ll reveal some of the interesting parts of Python that you might be unaware of. I find it a nice way to learn the internals of a programming language, and I think you’ll find them interesting as well!

If you’re an experienced Python programmer, you can take it as a challenge to get most of them right in first attempt. You may be already familiar with some of these examples, and I might be able to revive sweet old memories of yours being bitten by these gotchas.

https://github.com/satwikkansal/wtfpython

———————————–o0o———————————–

19. Automate the Boring Stuff with Python

If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you?

In Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand-no prior programming experience required. Once you’ve mastered the basics of programming, you’ll create Python programs that effortlessly perform useful and impressive feats of automation to:

https://automatetheboringstuff.com/

———————————–o0o———————————–

20. How to Write Python Unit Tests

So there you are, you just finished the last lines of code needed to complete a ticket on one of the big features of your application. Now what? Submit a pull request and have your team review it? Run your code through a linter to check for conventions? Manually test the new feature for validity? The answer is, yes to all of these ideas, but one thing is still missing. You still need to unit test your new feature to manually validate that the code in your new feature works. What does that do for you? Unit testing validates that given a bit of code, a desired output is achieved as a result of executing said code. Unit testing, unlike functional or system testing, is very black and white in nature and is a way to test the output of your code more than anything. Unit tests usually pass or fail and there is no gray area, but unit testing is an excellent technique to validate your code generates a targeted output. And that is why I wanted to write this tutorial, to demonstrate how unit tests works in Python, how easy it is to get started writing unit tests in your project, and then provide an example of a simple unit test as to illustrate how this works in Python.

https://www.agnosticdev.com/content/how-write-python-unit-tests

———————————–o0o———————————–

21. What Features Make Python a Great Programming Language

Programming can never go out of fashion in the computer science horizon. Programming is a skill, an art, and a science that must be learned, developed and explored. In the world of programmers, they need to learn more than one programming language to solve various kinds of problems. There is a continuous endeavor among programming language developers to offer better languages that are versatile, easy to learn and code, need minimum resources, platform independent and can be used to solve a variety of coding challenges. Python has emerged as a language that satisfies the needs of a programmer of this age who wants to be ready for different programming assignments.

http://www.it4nextgen.com/python-programming-language/

———————————–o0o———————————–

22. Working with strings in Python

String is a most used data type in python programming. A string is simply a series of characters. Anything inside quotes is considered as a string in Python, we can use either single or double quote. As python is a case sensitive language so string ‘an’ is considered different from string ‘An’. In python string represented by data type “str”.

Note: String is an immutable object in python. So, it cannot be modified.

https://learnbatta.com/blog/working-with-strings-in-python-38/

———————————–o0o———————————–

23. How to Sum Elements of Two Lists in Python

“Recently, I ran into a problem where a library wasn’t working exactly how I wanted, so I had to hack together the results to make my life a bit easier. In this scenario, I had a connection library which I was using to list all the available devices. However, the list functionality short circuited for certain types of connections, so it never actually listed everything. As a result, I was forced to run the function twice: once for USB and again for Ethernet.”

https://therenegadecoder.com/code/how-to-sum-elements-of-two-lists-in-python/

———————————–o0o———————————–

24. The definitive guide to Python exceptions

In Python, the base exception class is named BaseException. Being rarely used in any program or library, it ought to be considered as an implementation detail. But to discover how it’s implemented, you can go and read Objects/exceptions.c in the CPython source code. In that file, what is interesting is to see that the BaseException class defines all the basic methods and attribute of exceptions. The basic well-known Exception class is then simply defined as a subclass of BaseException, nothing more:

https://julien.danjou.info/python-exceptions-guide/

———————————–o0o———————————–

25. Understanding functions global variables and local variables in python programming

Python is a general-purpose, high-level, object-oriented programming language. One of the features that makes it distinct from other languages such as C++ and Java, is that it is an interpreted language. This means that python code does not need to be compiled. Because of that it allows for faster software development as compared to compiled languages.
Artificial intelligence witnessed a huge boom over the years when computing power increased exponentially. The next step forward is teaching computers to be automated. In areas of Artificial Intelligence such as Machine Learning, Python is one of the computer programming languages that is leading the charge.

Unlike the real-world Python that would scare any person away, Python is meant to be an easily comprehensible language with easy-to-learn syntax.

A key area where Python gained its popularity is in web development. Python is not only a great programming language on its own, but it is used as a backend language to support server-side logic code of a website to work in tandem with front-end languages, such as JavaScript and markup languages like HTML.

Over the years, Python has gained a lot of popularity. It has spanned a community of thousands of coders that is actively developing new projects, tutorials, guides, and helping out fellow coders. And because of that, new comers will find the programming language easier to understand. Your query is only one question away from being answered. Not to mention the various Python online courses available.

Let us explain a few aspects of Python that are also an integral part of the object-oriented programming space.

https://www.quickstart.com/blog/post/understanding-functions-global-variables-and-local-variables-in-python-programming/

———————————–o0o———————————–

26. How to access/view Python help when using vim

I am a new Vim text editor user. I am writing Python code. Is there is a way to see Python documentation within vim and without visiting the Internet? Say my cursor is under the print Python keyword, and I press F1. I want to look at the help for the print keyword. How do I show python help() inside vim? How do I call pydoc3/pydoc to seek help without leaving vim?

The pydoc or pydoc3 command show text documentation on the name of a Python keyword, topic, function, module, or package, or a dotted reference to a class or function within a module or module in a package. You can call pydoc from vim itself. Let us see how to access Python documentation using pydoc within vim text editor.

https://www.cyberciti.biz/faq/how-to-access-view-python-help-when-using-vim/

———————————–o0o———————————–

27. Python Programming Examples

Python Programming is one of the trending programming language, which is used in almost every filed of Information Technology. Python is used in Research and development of many trending technologies like Data Science, Internet of things and Machine Learning. Python Programming is easiest Language to Learn and provides high productivity in software development. This Section is built with Python Programming examples as a reference for Learners and Developers. All the Programming examples included are explained in detail.

http://www.decodeschool.com/Python-Programming/Examples

———————————–o0o———————————–

28. Cython: fast as GPUs without GPUs

Nowadays it is very common to heavily rely on intense computational power. For example, neural networks and deep learning are intensively employing graphical cards (GPGPU or GPUs) to extract weights in a reasonable computational time (e.g. seconds or minutes). This abundant usage of GPUs requires money, an API which is able to translate the source code in CUDA, for running and also a user-friendly written Python API.

https://medium.com/@stefanobosisio1/cython-fast-as-gpus-without-gpus-2c2e52cc4c42

———————————–o0o———————————–

29. Python : How to Remove Duplicates from a List

In this article we will discuss different ways to remove duplicate elements from a list in python.

https://thispointer.com/python-how-to-remove-duplicates-from-a-list/

———————————–o0o———————————–

30. Parallelism in one line

Python has a terrible rep when it comes to its parallel processing capabilities. Ignoring the standard arguments about its threads and the GIL (which are mostly valid), the real problem I see with parallelism in Python isn’t a technical one, but a pedagogical one. The common tutorials surrounding Threading and Multiprocessing in Python, while generally excellent, are pretty “heavy.” They start in the intense stuff, and stop before they get to the really good, day-to-day useful parts.

http://chriskiehl.com/article/parallelism-in-one-line/

———————————–o0o———————————–

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s