Tag: python

How to Use Variable and Keyword Arguments in Python
Post

How to Use Variable and Keyword Arguments in Python

Originally posted on makeuseof. Make your functions more flexible and easier to use with these variations on standard arguments. There are three types of arguments that a Python function can accept: standard, variable (*args), and keyword (**kwargs). Standard arguments are the simplest but have limited functionality. On the other hand, *args and **kwargs enable you...

Exploring Scopes and Closures in Python
Post

Exploring Scopes and Closures in Python

Originally posted on realpython. Have you been wondering how scopes and closures work in Python? Maybe you’ve just heard about object.__closure__, and you’d like to figure out what exactly it does. In this Code Conversation video course, you’ll use the debugger Thonny to walk through some sample code and get a better understanding of scopes and closures in...

The 6 Python Machine Learning Tools Every Data Scientist Should Know About
Post

The 6 Python Machine Learning Tools Every Data Scientist Should Know About

Originally posted on kdnuggets. Let’s look at six must-have tools every data scientist should use. Machine learning is rapidly evolving and the crucial focus of the software development industry. The infusion of artificial intelligence with machine learning has been a game-changer. More and more businesses are focusing on wide-scale research and implementation of this domain....

PyScript Beta Lets You Run Python in the Browser
Post

PyScript Beta Lets You Run Python in the Browser

Originally posted on makeuseof. JavaScript has long dominated client-side web programming, but could a new Python framework shake things up? PyScript is a framework, built with Pyodide, allowing you to run Python code in a browser. It’s still in its infancy, but the dev team has recently released a beta version. Using the tool, developers...

How to Use Python to Reverse a String
Post

How to Use Python to Reverse a String

Originally posted on makeuseof. Either one of these approaches works, so find out which is most suitable for you. Python has many useful string functions, like casefold() which converts a string to lower case. There is no string-reversing function built into the language. However, there are two simple approaches you can use to reverse a...

How to Execute SQL Queries in Python and R Tutorial
Post

How to Execute SQL Queries in Python and R Tutorial

Originally posted on datacamp. Learn easy and effective ways to run SQL queries in Python and R for data analysis and database management. What is SQL Structured Query Language (SQL) is the most common language used for running various data analysis tasks. It is also used for maintaining a relational database, for example: adding tables,...

Logging in Python
Post

Logging in Python

Originally posted on machinelearningmastery. Logging is a way to store information about your script and track events that occur. When writing any complex script in Python, logging is essential for debugging software as you develop it. Without logging, finding the source of a problem in your code may be extremely time consuming. After completing this...

11 Bite-Sized Python Recipes You Must Know
Post

11 Bite-Sized Python Recipes You Must Know

Originally posted on makeuseof. These code samples will help you learn about Python basics and solve common everyday challenges. Many programmers like Python for its simple and concise syntax. These Python recipes are small sample programs that you can use to solve common daily problems. Use these easy-to-digest Python recipes and take your coding efficiency...

Data Visualization in Python with matplotlib, Seaborn and Bokeh
Post

Data Visualization in Python with matplotlib, Seaborn and Bokeh

Originally posted on machinelearningmastery. Data visualization is an important aspect of all AI and machine learning applications. You can gain key insights of your data through different graphical representations. In this tutorial, we’ll talk about a few options for data visualization in Python. We’ll use the MNIST dataset and the Tensorflow library for number crunching...

A Gentle Introduction to Serialization for Python
Post

A Gentle Introduction to Serialization for Python

Originally posted on machinelearningmastery. Serialization refers to the process of converting a data object (e.g. Python objects, Tensorflow models) into a format that allows us store or transmit the data and then recreate the object when needed using the reverse process of deserialization. There are different formats for serialization of data, such as JSON, XML,...

How to use httpx, a web client for Python
Post

How to use httpx, a web client for Python

Originally posted on opensource. The httpx package for Python is an excellent and flexible module for interacting with HTTP. The httpx package for Python is a sophisticated web client. Once you install it, you can use it to get data from websites. As usual, the easiest way to install it is with the pip utility: $ python -m pip install httpx --user To use it,...

A Complete Guide to Python Dictionaries for Beginners
Post

A Complete Guide to Python Dictionaries for Beginners

Originally posted on dev. Table of Contents Introduction Definition Creating Python dictionary Accessing dictionary items Changing and Adding Values Removing Items Looping through a Dictionary Dictionary Methods To Sum It Up Introduction Python Dictionary is a composite data type. It is an ordered collection of data values that is used to store them. Each Dictionary...

How to Create a Monte Carlo Simulation using Python
Post

How to Create a Monte Carlo Simulation using Python

Originally posted on towardsdatascience. Walkthrough an example to learn what a Monte Carlo simulation is and how it can be used to predict probabilities What is a Monte Carlo Simulation? A Monte Carlo simulation is a type of computational algorithm that estimates the probability of occurrence of an undeterminable event due to the involvement of...

5 Advanced Tips on Python Objects
Post

5 Advanced Tips on Python Objects

Originally posted on towardsdatascience Python is an object oriented programming language but can behave strangely. If you come from other OOP languages, this post may benefit you In chapter 8 of Fluent Python, Luciano Ramalho discusses how python objects under the hood. Here will define the fundamental concept behind variable storage in python and explore some...

How to Write SQL in Native Python
Post

How to Write SQL in Native Python

Originally posted on kdnuggets. If the idea of being able to link with SQL databases and define, manipulate, and query using Python sounds appealing, check out the SQLModel library. Do you write a lot of SQL? Do you end up calling a lot of this SQL from within Python? Does the idea of being able...

Intro to Machine Learning with TensorFlow
Event

Intro to Machine Learning with TensorFlow

This is a 16-hour course on Tensorflow. We will explore Tensorflow architecture and application programming interfaces to build machine learning algorithms and train then on a real world dataset. During the course you will cover the following topics: Introduction to Tensorflow Present a small model end to end using Jupyter Notebook Present a small model end to...

Python Switches to Match-Case
Post

Python Switches to Match-Case

Originally posted on dev. If reading about code with foo, bar, and math examples is the bane of your existence, keep reading. Expect examples with sweaters and dogs. Jump to: Past Present Benefits Example 1 Example 2 Future Past Once upon a time, in 2006, a Python Enhancement Proposal(PEP) was introduced. PEP 3103 detailed many different ways a switch...