1616483777
I’ve been using pandas for a few years and each time I feel I am typing too much, I google the operation and I usually find a shorter way of doing it — a new pandas trick!
I learned about these functions recently and I deem them essential because of ease of use.
By reading this article, you’ll learn:
#pandas #data-science #programming #python
1623355500
When you get introduced to machine learning, the first step is to learn Python and the basic step of learning Python is to learn pandas library. We can install pandas library by pip install pandas. After installing we have to import pandas each time of the running session. The data used for example is from the UCI repository “https://archive.ics.uci.edu/ml/datasets/Heart+failure+clinical+records ”
2. Head and Tail
3. Shape, Size and Info
4. isna
…
#pandas: most used functions in data science #pandas #data science #function #used python data #most used functions in data science
1605017502
Other then the syntactical differences. The main difference is the way the this keyword behaves? In an arrow function, the this keyword remains the same throughout the life-cycle of the function and is always bound to the value of this in the closest non-arrow parent function. Arrow functions can never be constructor functions so they can never be invoked with the new keyword. And they can never have duplicate named parameters like a regular function not using strict mode.
this.name = "Bob";const person = {
name: “Jon”,<span style="color: #008000">// Regular function</span> func1: <span style="color: #0000ff">function</span> () { console.log(<span style="color: #0000ff">this</span>); }, <span style="color: #008000">// Arrow function</span> func2: () => { console.log(<span style="color: #0000ff">this</span>); }
}
person.func1(); // Call the Regular function
// Output: {name:“Jon”, func1:[Function: func1], func2:[Function: func2]}person.func2(); // Call the Arrow function
// Output: {name:“Bob”}
const person = (name) => console.log("Your name is " + name); const bob = new person("Bob"); // Uncaught TypeError: person is not a constructor
#arrow functions #javascript #regular functions #arrow functions vs normal functions #difference between functions and arrow functions
1623901437
Pandas is arguably the most popular data analysis and manipulation tool in the data science ecosystem. Thanks to the numerous functions and methods, we can play around with data freely.
The cut and qcut functions come in quite handy for many cases. The difference between them was not clear to me at first. I was able to figure it out after doing several examples.
In this article, we will do the same. The examples in this article will demonstrate how to use the cut and qcut functions and also emphasize the difference between them.
Let’s start with creating a sample data frame.
import numpy as np
import pandas as pd
df = pd.DataFrame({
"col_a": np.random.randint(1, 50, size=50),
"col_b": np.random.randint(20, 100, size=50),
"col_c": np.random.random(size=50).round(2)
})
df.head()
#artificial-intelligence #pandas #programming #data-science #python #all you need to know about pandas cut and qcut functions
1623578460
Pandas library is a very popular python library for data analysis. Pandas library has so many functions. This article will discuss three very useful and widely used functions for data summarizing. I am trying to explain it with examples so we can use them to their full potential.
The three functions I am talking about today are count, value_count, and crosstab.
The count function is the simplest. The value_count can do a bit more and the crosstab function does even more complicated work with simple commands.
#data-science #programming #artificial-intelligence #three very useful functions of pandas to summarize the data #pandas #functions
1620301440
Pandas is clearly one of the most used and loved libraries when it comes to Data Science and Data Analysis with Python. What makes it special? In this tutorial, we will go over 5 such functions that make Pandas an extremely useful tool in a Data Scientist’s tool kit.
By the end of this tutorial, you’ll have the knowledge of the below functions in Pandas and how to use them for your applications:
#data science #pandas #pandas for data science #pandas functions