Control Raspberry Pi GPIO Pins Using Python

S Vijay Balaji
Updated on 31-Aug-2023 12:31:51

930 Views

Raspberry Pi is a popular single−board computer that is widely used for various projects, ranging from home automation to robotics. One of the key features of Raspberry Pi is its ability to interface with the physical world through its GPIO (General Purpose Input/Output) pins. These pins allow you to connect sensors, actuators, and other electronic components to the Raspberry Pi and control them with software. Python is a versatile programming language that is widely used for developing applications on Raspberry Pi. In fact, the Raspberry Pi OS comes with Python pre−installed, making it a natural choice for programming GPIO pins. ... Read More

Automatically Compile TypeScript Files with Visual Studio Code on OS X

Mohit Panchasara
Updated on 31-Aug-2023 12:30:44

1K+ Views

TypeScript is a popular programming language that is widely used in the web development industry. It is an open-source, strongly typed, and object-oriented programming language that is a superset of JavaScript. TypeScript is very similar to JavaScript, but it has a few additional features that make it more powerful and efficient. One of the best things about TypeScript is that it can be compiled into JavaScript, which can be run in any browser or on any server. In this article, we will discuss how to automatically compile TypeScript files with Visual Studio Code on OS X. Visual Studio Code is ... Read More

Building a Stock Price Prediction Model with Python and Pandas

S Vijay Balaji
Updated on 31-Aug-2023 12:30:16

817 Views

Stock price prediction is a frequent use case in machine learning and data analysis. We can construct models that forecast future stock prices with fair accuracy by analysing past trends and patterns in the stock market. In this lesson, we'll look at how to use Python and the pandas package to create a stock price prediction model. The pandas library is a popular Python data analysis package. It includes a comprehensive collection of tools for working with structured data, such as data frames and series. We'll use pandas to analyse and manipulate stock data before developing a machine learning model ... Read More

Readonly Properties in TypeScript

Mohit Panchasara
Updated on 31-Aug-2023 12:24:44

497 Views

In TypeScript, properties are an essential part of defining the structure and behavior of objects. They allow us to encapsulate data and provide a way to access and manipulate it. By default, properties in TypeScript can be both read and write, meaning they can be both accessed and modified. However, there are scenarios where we may want to create properties that can only be read and not modified. This is where readonly properties come into play. Readonly properties provide a way to define properties that can only be accessed and not changed once they are assigned a value. They are ... Read More

Minimize Last Remaining Element of Array by Selecting Pairs

Prabhdeep Singh
Updated on 31-Aug-2023 12:20:15

134 Views

We are given an array of non-negative integers and we have to perform an operation of the given array any number of times possible so that we can choose any element of the array and can choose another element from the array that will be less than or equal to the current element and we will subtract it from the first element. After subtracting we will remove the first element if it becomes zero. After applying the above-described method any number of possible times we have to find the minimum possible element present in the array. ... Read More

Parse XML and Count Instances of a Particular Node Attribute in Python

Tarun Singh
Updated on 31-Aug-2023 12:16:50

1K+ Views

Parsing XML and counting instances of a particular node attribute in Python can be achieved through various methods. XML is a widely used format for storing and exchanging structured data. Python provides several libraries and approaches for parsing XML, including ElementTree, lxml, and xml.etree.ElementTree. In this article, we will learn how to parse XML and count instances of a particular node attribute in Python. We will cover different approaches using the available XML parsing libraries and demonstrate practical examples. By the end of this article, you will have a solid understanding of how to parse XML and count instances ... Read More

Parse Local HTML File in Python

Tarun Singh
Updated on 31-Aug-2023 12:14:17

5K+ Views

Parsing local HTML files in Python is a common task when dealing with web scraping, data analysis, and automation. In this article, we will learn how to parse local HTML files in Python. We will explore various techniques to extract data from an HTML file using Python. We will cover modifying and removing elements from the file, printing data, using recursive child generators to traverse the file's structure, finding tag children, and even web scraping by extracting information from a given link. Through code examples and syntax, we will demonstrate how to leverage Python libraries such as BeautifulSoup and ... Read More

Order PySpark DataFrame by Multiple Columns

Tarun Singh
Updated on 31-Aug-2023 12:12:56

1K+ Views

When working with large datasets, one common PySpark operation is to order a DataFrame by multiple columns. You can prioritize the sorting based on various criteria when you sort data based on multiple columns. Using PySpark, we'll look at a few different approaches in this article. In this article, we will learn How to Order PysPark DataFrame by Multiple Columns. PySpark provides several methods to order DataFrames where each method offers different features and performance characteristics, so let's dive into each one and understand how to use them. Different Method to Order PysPark DataFrame by Multiple Columns There are various ... Read More

Move Game Character Around in Pygame

Tarun Singh
Updated on 31-Aug-2023 12:08:06

3K+ Views

Pygame is a powerful library that allows developers to create engaging 2D games using the Python programming language. One fundamental aspect of game development is character movement. In this article, we will learn how to move your game character around in Pygame. This article is for everyone whether you're a beginner or an experienced developer, and will equip you with the knowledge and skills necessary to implement smooth and responsive character movement in your games. Steps to move game characters around in Pygame Below are the complete steps to move your game character around in Pygame: Step 1: Setting ... Read More

Count of Triplets in Binary String with Same Bitwise AND

Prabhdeep Singh
Updated on 31-Aug-2023 12:06:32

199 Views

A binary string is a type of string which contains only binary characters that are '0' and '1'. We are given a binary string and have to find the triplets that fulfill the condition that the bitwise 'AND' of the first two characters is equal to the bitwise 'AND' of the last two characters. Mathematically: For 0

Advertisements