Language Selection

English French German Italian Portuguese Spanish

Python Programming Leftovers

Filed under
Development
  • Wing Tips: Introducing Variables with Refactoring in Wing Pro

    In past issues of Wing Tips we covered a number of the refactoring operations available in Wing Pro, such as renaming symbols, moving symbols, and introducing functions and methods. To finish our series on refactoring, let's take a look at how to introduce a variable based on existing Python code, using Wing Pro's Introduce Variable refactoring operation.
    This operation is used to replace selected occurrences of an expression with a new local variable, either to make code more readable or to avoid redundant computation.

  • A Guide to Excel Spreadsheets in Python With openpyxl

    Excel spreadsheets are one of those things you might have to deal with at some point. Either it’s because your boss loves them or because marketing needs them, you might have to learn how to work with spreadsheets, and that’s when knowing openpyxl comes in handy!

    Spreadsheets are a very intuitive and user-friendly way to manipulate large datasets without any prior technical background. That’s why they’re still so commonly used today.

  • Combine Multiple Excel Worksheets Into a Single Pandas Dataframe
  • Minimax with Alpha-Beta Pruning in Python

    Shortly after, problems of this kind grew into a challenge of great significance for development of one of today's most popular fields in computer science - artificial intelligence. Some of the greatest accomplishments in artificial intelligence are achieved on the subject of strategic games - world champions in various strategic games have already been beaten by computers, e.g. in Chess, Checkers, Backgammon, and most recently (2016) even Go.

    Although these programs are very successful, their way of making decisions is a lot different than that of humans. The majority of these programs are based on efficient searching algorithms, and since recently on machine learning as well.

    The Minimax algorithm is a relatively simple algorithm used for optimal decision-making in game theory and artificial intelligence. Again, since these algorithms heavily rely on being efficient, the vanilla algorithm's performance can be heavily improved by using alpha-beta pruning - we'll cover both in this article.

  • Python MANOVA Made Easy using Statsmodels

    n previous posts, we learned how to use Python to detect group differences on a single dependent variable. However, there may be situations in which we are interested in several dependent variables. In these situations, the simple ANOVA model is inadequate.

    One way to examine multiple dependent variables using Python would, of course, be to carry out multiple ANOVA. That is, one ANOVA for each of these dependent variables. However, the more tests we conduct on the same data, the more we inflate the family-wise error rate (the greater chance of making a Type I error).

    This is where MANOVA comes in handy. MANOVA, or Multivariate Analysis of Variance, is an extension of Analysis of Variance (ANOVA). However, when using MANOVA we have two, or more, dependent variables.

  • Mike Driscoll: PyDev of the Week: Frank Wiles

    This week we welcome Frank Wiles (@fwiles) as our PyDev of the Week! Frank is the President and Founder of Revolution Systems and President of the Django Software Foundation. If you’d like to know about Frank, you should take a moment to check out his website or his Github account. For now, let’s take some time to get to know him better!

    [...]

    I switched to a new laptop a couple of months ago and am trying to do most everything in Docker containers and fully 12-Factor, which has the side benefit of things I would not normally release publicly can be. So I’m trying to code “in the open” a bit more than I used to.

    I’m currently working on improving the docs around some of REVSYS’ open source projects like django-test-plus.

  • Quick and dirty mock service with Starlette

    The Python ecosystem is full of strong options to address the first part of the solution. Django, Flask, Pyramid, Bottle, and any other web framework you can think of would handle that with ease.

    The second part of the solution is harder. If I’m not careful, then being simple goes out the window, and I’ve destroyed the third objective.

  • Profitable Python Episode: Put Your Family First

    During the interview, I was asked how I would like to have Python runnable in the browser and I couldn’t recall the name of a product that makes this sort of thing possible. The product I was thinking of was Anvil, which while still not quite having Python in the browser, it’s close.

  • Test and Code: 85: Speed Up Test Suites - Nicklas Meinzer

    Good software testing strategy is one of the best ways to save developer time and shorten software development delivery cycle time.

    Software test suites grow from small quick suites at the beginning of a project to larger suites as we add tests, and the time to run the suites grows with it.

    Fortunately, pytest has many tricks up it's sleave to help shorten those test suite times.

  • AI Driven Automated Code Review With DeepCode

    Software engineers are frequently faced with problems that have been fixed by other developers in different projects. The challenge is how and when to surface that information in a way that increases their efficiency and avoids wasted effort. DeepCode is an automated code review platform that was built to solve this problem by training a model on a massive array of open sourced code and the history of their bug and security fixes. In this episode their CEO Boris Paskalev explains how the company got started, how they build and maintain the models that provide suggestions for improving your code changes, and how it integrates into your workflow.

  • Introduction to AWS beanstalk platform

    In this tutorial, I am going to show you how to deploy your Python based flask application to AWS Beanstalk.

    There could be 2 ways to host your application to AWS beanstalk platform, one is using web interface of AWS beanstalk and another is Command Line Interface (CLI).

  • PyCoder’s Weekly: Issue #383 (Aug. 27, 2019)
  • Python for NLP: Multi-label Text Classification with Keras

    This is the 19th article in my series of articles on Python for NLP. From the last few articles, we have been exploring fairly advanced NLP concepts based on deep learning techniques. In the last article, we saw how to create a text classification model trained using multiple inputs of varying data types. We developed a text sentiment predictor using textual inputs plus meta information.

    In this article, we will see how to develop a text classification model with multiple outputs. We will be developing a text classification model that analyzes a textual comment and predicts multiple labels associated with the comment. The multi-label classification problem is actually a subset of multiple output model. At the end of this article you will be able to perform multi-label text classification on your data.

    The approach explained in this article can be extended to perform general multi-label classification. For instance you can solve a classification problem where you have an image as input and you want to predict the image category and image description.

    At this point, it is important to explain the difference between a multi-class classification problem and a multi-label classification. In multi-class classification problem, an instance or a record can belong to one and only one of the multiple output classes. For instance, in the sentiment analysis problem that we studied in the last article, a text review could be either "good", "bad", or "average". It could not be both "good" and "average" at the same time. On the other hand in multi-label classification problems, an instance can have multiple outputs at the same time. For instance, in the text classification problem that we are going to solve in this article, a comment can have multiple tags. These tags include "toxic", "obscene", "insulting", etc., at the same time.

  • Python Software Foundation Fellow Members for Q1 & Q2 2019

    We are happy to announce our newest PSF Fellow Members! This group includes nominated Fellows from Q1 and Q2 of 2019.

  • EPS Board 2019/2020

    For those of you who were not at EuroPython 2019, we’re happy to announce our new board for the next term:
    Anders Hammarquist (Treasurer)
    Angel Ramboi
    Jakub Musko
    Marc-André Lemburg (Chair)
    Martin Christen (Vice Chair)
    Raquel Dou
    Silvia Uberti
    Stéphane Wirtel

  • How to Use Python Lambda Functions

    Python and other languages like Java, C#, and even C++ have had lambda functions added to their syntax, whereas languages like LISP or the ML family of languages, Haskell, OCaml, and F#, use lambdas as a core concept. Python lambdas are little, anonymous functions, subject to a more restrictive but more concise syntax than regular Python functions.

  • Learning Python

    Did I need to read a fifteen hundred page book to learn Python?
    At the end of fourteen hundred pages, I can safely assure you, I did not.

    If you want to just solve your pressing issues or scratch your itch, or just plain get started with programming (and programming in Python specifically), I’d recommend starting with a simple, fast paced book, like Python for you and me, and then doing tons of practice.1

    Mark Lutz, as he closes the book, himself laments that Python has gotten too big to hold in your head. And by doing so, has lost some of the simplicity and the joy and fun and the magic, Python held for the early adopters of the language.

More in Tux Machines

digiKam 7.7.0 is released

After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. Read more

Dilution and Misuse of the "Linux" Brand

Samsung, Red Hat to Work on Linux Drivers for Future Tech

The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. Read more

today's howtos

  • How to install go1.19beta on Ubuntu 22.04 – NextGenTips

    In this tutorial, we are going to explore how to install go on Ubuntu 22.04 Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions. Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection. In this guide, we are going to learn how to install golang 1.19beta on Ubuntu 22.04. Go 1.19beta1 is not yet released. There is so much work in progress with all the documentation.

  • molecule test: failed to connect to bus in systemd container - openQA bites

    Ansible Molecule is a project to help you test your ansible roles. I’m using molecule for automatically testing the ansible roles of geekoops.

  • How To Install MongoDB on AlmaLinux 9 - idroot

    In this tutorial, we will show you how to install MongoDB on AlmaLinux 9. For those of you who didn’t know, MongoDB is a high-performance, highly scalable document-oriented NoSQL database. Unlike in SQL databases where data is stored in rows and columns inside tables, in MongoDB, data is structured in JSON-like format inside records which are referred to as documents. The open-source attribute of MongoDB as a database software makes it an ideal candidate for almost any database-related project. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MongoDB NoSQL database on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.

  • An introduction (and how-to) to Plugin Loader for the Steam Deck. - Invidious
  • Self-host a Ghost Blog With Traefik

    Ghost is a very popular open-source content management system. Started as an alternative to WordPress and it went on to become an alternative to Substack by focusing on membership and newsletter. The creators of Ghost offer managed Pro hosting but it may not fit everyone's budget. Alternatively, you can self-host it on your own cloud servers. On Linux handbook, we already have a guide on deploying Ghost with Docker in a reverse proxy setup. Instead of Ngnix reverse proxy, you can also use another software called Traefik with Docker. It is a popular open-source cloud-native application proxy, API Gateway, Edge-router, and more. I use Traefik to secure my websites using an SSL certificate obtained from Let's Encrypt. Once deployed, Traefik can automatically manage your certificates and their renewals. In this tutorial, I'll share the necessary steps for deploying a Ghost blog with Docker and Traefik.