Статьи, новости и советы по Python, page 2

What is Web Scraping?

Some websites and platforms offer application programming interfaces (APIs) which we can use to access information in a structured way, but others might not. While APIs are certainly becoming the standard way of interacting with today’s popular platforms, we don’t always have this luxury when interacting with most of the websites on the internet.

Guide: Pandas DataFrames for Data Analysis

“Data scientist” is one of the hottest jobs in tech, and Python is the lingua franca of data science. Python’s easy-to-learn syntax, open ecosystem, and strong community has made it one of the fastest growing languages in recent years. In this post, we’ll learn about Pandas, a high-performance open-source package for doing data analysis in Python.

The Pandas Library for Python

So, what is Pandas – practically speaking? In short, it’s the major data analysis library for Python. For scientists, students, and professional developers alike, Pandas represents a central reason for any learning or interaction with Python, as opposed to a statistics-specific language like R, or a proprietary academic package like SPSS or Matlab.

Python For Loops: Quick Answers and Examples

Much of the benefit we get from using computers is from programming them to do the same task multiple times in a row, which requires repeating the same block of code again and again. This is where for each loops are useful in Python, or any other object-oriented programming (OOP) language. We will use for loop and for each loop interchangeably, as the Python for loop is always associated with some collection of items to which the each refers, and it is helpful to think about the items to be worked with. Officially, the Python documentation refers to the for loop as the “for statement.”

ThreadPoolExecutor in Python: The Complete Guide

The Python ThreadPoolExecutor allows you to create and manage thread pools in Python. Although the ThreadPoolExecutor has been available since Python 3.2, it is not widely used, perhaps because of misunderstandings of the capabilities and limitations of Threads in Python. This guide provides a detailed and comprehensive review of the ThreadPoolExecutor in Python, including how it works, how to use it, common questions, and best practices.

Python Decorators

Decorators are quite a useful Python feature. However, it can seem that any resources or insights surrounding them makes the whole concept impossible to understand. But decorators are, in fact, quite simple. Read on, and we’ll show you why.

Python List Comprehensions

Lists are easy to recognize in Python. Whenever we see brackets ‘[]’, we know that lists are afoot. Declaring lists is just about as easy as gets in Python.

Pyton Regular Expressions

REGEX is a module used for regular expression matching in the Python programming language. In fact, REGEX is actually just short for regular expressions, which refer to the pattern of characters used in a string. This concept can apply to simple words, phone numbers, email addresses, or any other number of patterns.

Guide to Python Dictionaries

Second to a Python list, the dictionary or “dict” is a place in memory to store a series of values – also called a collection. The dictionary is special because values are not referenced in order using a numerical index. Rather, in a dictionary, values are referenced with a user-defined key, just as words in a physical dictionary are “keys” associated with the “value” of their meaning. This key is usually a string, but could be any number of data types.

Guide to String Formatting with Python

String formatting is a robust and powerful part of any python programmer’s toolkit – nearly every piece of production software takes advantage of it in one way or another. The means of formatting strings, though, have greatly evolved over Python’s lifetime. From the % formatting, to the format() method, to formatted string literals, there’s no limit as to the potential of string crafting.

Practical Machine Learning with Python and Keras

Machine learning is a field of artificial intelligence that uses statistical techniques to give computer systems the ability to “learn” (e.g., progressively improve performance on a specific task) from data, without being explicitly programmed. Think of how efficiently (or not) Gmail detects spam emails, or how good text-to-speech has become with the rise of Siri, Alexa, and Google Home.

Best Practices for Using Functional Programming in Python

Python is a very versatile, high-level programming language. It has a generous standard library, support for multiple programming paradigms, and a lot of internal transparency. If you choose, you can peek into lower layers of Python and modify them – and even modify the runtime on the fly as the program executes.

TensorFlow or PyTorch? A Guide to Python Machine Learning Libraries (with examples!)

Python is the fastest-growing programming language out there. That isn’t surprising given that it’s simple, easy to use, free, and applicable for many computing tasks. Data scientists in particular have embraced Python’s efficient syntax, learnability, and easy integrations with other languages such as C and C++.

Web Scraping with Python: A Tutorial on the BeautifulSoup HTML Parser

Web scraping is a technique employed to extract a large amount of data from websites and format it for use in a variety of applications. Web scraping allows us to automatically extract data and present it in a usable configuration, or process and store the data elsewhere. The data collected can also be part of a pipeline where it is treated as an input for other programs.

Python in the Command Line: A Tutorial on Click

While I was spending my weekend on one of my favorite pastimes, writing Python code, and found a way to generate a 3D QR code of my WIFI password. In the process, I had some interesting epiphanies, mainly that Command Line Interfaces (CLIs) and Web Apps share some striking commonalities.

How to Use Pandas GroupBy, Counts and Value Counts

If you’re a data scientist, you likely spend a lot of time cleaning and manipulating data for use in your applications. One of the core libraries for preparing data is the Pandas library for Python.

Data Science, the Good, the Bad, and the… Future

How often do you think you’re touched by data science in some form or another? Finding your way to this article likely involved a whole bunch of data science (whooaa). To simplify things a bit, I’ll explain what data science means to me. “Data Science is the art of applying scientific methods of analysis to any kind of data so that we can unlock important information.”

Time Series Analysis with Pandas

Python’s pandas library is frequently used to import, manage, and analyze datasets in a variety of formats. In this article, we’ll use it to analyze Amazon’s stock prices and perform some basic time series operations.

Statistical Modeling with Python: How-to & Top Libraries

One of the most important factors driving Python’s popularity as a statistical modeling language is its widespread use as the language of choice in data science and machine learning.

Handling Imbalanced Datasets with SMOTE in Python

Close your eyes. Now imagine a perfect data world. What do you see? What do you wish to see? Exactly, me too. A flawlessly balanced dataset. A collection of data whose labels form a magnificent 1:1 ratio: 50% of this, 50% of that; not a bit to the left, nor a bit to the right. Just perfectly balanced, as all things should be. Now open your eyes, and come back to the real world.