Go deeper with the language powering everything.

# Optimized World

## A guide to optimization problems with Google OR-Tools for Python

“Every human being has a “good heart” and another “evil heart”!
Optimization of both is required to excel, it is a non-trivial quest.”

# Topics Covered

1. Optimization problem, what is it?
2. Guide to Linear Optimization — Solver glop and Simplex algorithm
3. Guide to Linear Optimization — Guide to Linear Optimization -
4. Guide to Integer Optimization — MIP Solver
5. Guide to Integer Optimization — Solving a MIP Problem
6. Guide to Integer Optimization — Using Arrays to Define a Model
7. Constraint Optimization — CP-SAT Solver
8. Constraint Optimization — Using a CP-SAT Problem
9. Constraint Optimization — Solving a CP-SAT Problem
10. Constraint Optimization — Cryptarithmetic Puzzles
11. Constraint Optimization — The N-queens…

# The correct use of ColumnTransformer() in the Kaggle Titanic competition

Sklearn has got to be one of my favourite libraries in Python. This library is not static, as it frequently introduces new functions in its updated releases. The current version of sklearn is 0.23.2 where it has introduced new features, such as: visual representation of estimators, improvements to K-means, improvements to gradient boosting, new generalised linear models, and sample weight support for existing regressors. It is always a good idea, therefore to find out the new features of this fascinating library and incorporate them into programming in an attempt to improve performance.

One new feature in sklearn’s version 0.20 is ColumnTransformer(). This function applies transformers to columns of an array or pandas DataFrame. It allows different columns or column subsets of the input to be transformed separately and the features generated by each transformer will be concatenated to form a single feature space. …

# Coding A Simple Game Model By Creating Functions In Python: “Three Cup Monte”

## Fiction the game in which cup with the ball with Python

It is useful in many areas for Python users. It maintains its prestige by reaching a wider audience thanks to its understandable and easy-to-read code structure. In this way, Python training has become an important focus today. And certainly there is a lot more to understand it easier now.

Now, coming to the topic of this article, quick tutorials can bring a level. And especially as far as functions are concerned, we know that perhaps most people can have a basic knowledge fast without getting too tired. However, from this point on, the details start to get boring. You will always need practical projects to learn in depth. …

# How to Use the Kaggle API in Python

Kaggle is the world’s platform for everything data science. Like a strange social network, full of data scientists, with Jupyter notebooks everywhere.

It’s a great platform to learn and compete thanks to the dazzlingly large number of competitions on the site posted by companies looking for solutions to their data science problems, without spending too much.

This ecosystem unsurprisingly produces a lot of datasets — which is why you’re here. You want to download data from Kaggle with Python, and that is exactly what we will do.

If you prefer video, we cover the Kaggle API setup and use here…

# Linear Search

In linear search, each element of the array/list is compared from the beginning to the end with the element entered to be searched for.

Linear Search is also called as sequential search .

In linear search, it is not compulsory to have the elements sorted. The elements can be in any order.

# The use of Catboost in solving an ordinal classification problem

I do not have a lot of experience with CatBoost, but since it is said to be as good as XGBoost and LightGBM I thought I should become familiar with this model. CatBoost is a fast, scalable, high performance gradient boosting on decision trees library. This model is used for ranking, classification, regression and other machine learning task. CatBoost is developed by Yandex researchers and engineers, and is used for search, recommendation systems, personal assistant, self-driving cars, weather prediction and many other tasks. …

# Feature Engineering with .map(), .apply(), and Lambda Functions in Pandas

## Tutorial on Applying Functions to Pandas DataFrames

Feature Engineering is an important step in the Data Science workflow. It is the process of extracting features from raw data using data mining techniques and domain knowledge. This can involve performing transformations or univariate, binary, and multivariate statistical analysis on existing data. These derived values can make data more intuitive for analysts and their algorithms. An experienced practitioner can quickly assess the problem and brainstorm new features to create based on existing data. These features, ranging in complexity, may require calculations that are easily done (and more readable) using Lambda functions. …

# How To Efficiently Concatenate Strings In Python

## And how not to concatenate strings

I always used to concatenate strings using the “+” operator irrespective of the language I code only to realize later that I was doing them wrong. To be precise, inefficient.

Today, we shall discuss string concatenation in python and how to do it efficiently.

`x =  "hello"y =  "world"print(x + y)Output:hello world`

As we are aware of the fact that string objects are immutable in python, any concatenation operation using the “+” operator could prove to be costly.

Why is it so?

String objects are immutable in python and any concatenation operation creates a new string, copies the old string character by character and then appends the new string to be concatenated. …

# Send an Embed with a Discord Bot in Python

## Upgrade your bot’s messages and make them a little more custom using embeds!

When your Discord bot responds to your server, you don’t always want a boring default message to be sent back. Maybe you have links or images that you want to send back in chat. With Python and Discord.py, this is super easy to do in your Discord bot!

Note: This is tested on version 1.4.1 of the Discord.py module. You will encounter issues if you are using a version lower than 1.0. It is recommended that you migrate your code to a more current version.

# Building Embeds

Embeds in Discord are simple and have a very clean, formatted look to them. In this tutorial we will go through how to create an embed and customize every part of it. …

# Linked Lists, Stacks and Queues using Python

GeeksforGeeks describes Linked list as a linear data structure, in which the elements are not stored at contiguous memory locations. These elements are called as nodes. Each node contains a data field and a reference (link) to the next node in the list.

Few common types of linked lists are as follows —