• Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar

Python and R Tips

Learn Data Science with Python and R

  • Home
  • Python
  • Pandas
    • Pandas 101
  • tidyverse
    • tidyverse 101
  • R
  • Linux
  • About
    • Privacy Policy
You are here: Home / Archives for Python / Python Tips

Python Tips

How To Insert a Column at Specific Location in Pandas DataFrame?

April 1, 2020 by cmdlinetips

In this post, we will learn how to insert a column at specific location in a Pandas dataframe. We will use Pandas insert() function to insert column into DataFrame at a specified location with a specific name. Let us create a data frame using NumPy’s random module. Our data frame looks like this. We have […]

Filed Under: Pandas 101, Python Tips Tagged With: Insert a column in Pandas, pandas insert()

Linear Regression Using Matrix Multiplication in Python Using NumPy

March 17, 2020 by cmdlinetips

Linear Regression fit with Matrix Multiplication in Python

Linear Regression is one of the commonly used statistical techniques used for understanding linear relationship between two or more variables. It is such a common technique, there are a number of ways one can perform linear regression analysis in Python. In this post we will do linear regression analysis, kind of from scratch, using matrix […]

Filed Under: Linear Regression by Matrix Multiplication, Linear Regression in Python, Python Tips, Scikitlearn Linear Regression Tagged With: Linear Regression, Linear Regression by Matrix Multiplication

How To Discretize/Bin a Variable in Python with NumPy and Pandas?

December 9, 2019 by cmdlinetips

Sometimes you may have a quantitative variable in your data set and you might want to discretize it or bin it or categorize it based on the values of the variable. For example, let us say you have measurements of height and want to discretize it such that it is 0 or 1 depending on […]

Filed Under: NumPy Digitize, Pandas Cut, Pandas DataFrame, Python Bin

How to Highlight Data Points with Colors and Text in Python

November 5, 2019 by cmdlinetips

How To Highlight Data Annotate with Text Python?

Sometimes you might want to highlight a select data points on a scatter plot. Often when plotting scatter plots you might want to highlight data points in a different color from the rest of the data points. Other times you want to show select data points in different color and annotate them with text. In […]

Filed Under: Annotate matplotlib, Highlight Data Points in Color Python, Python, Python Tips Tagged With: Highlight select points in Python

Pandas groupby: 13 Functions To Aggregate

October 2, 2019 by cmdlinetips

Fun with Pandas Groupby, Agg,

Pandas groupby function enables us to do “Split-Apply-Combine” data analysis paradigm easily. Basically, with Pandas groupby, we can split Pandas data frame into smaller groups using one or more variables. Pandas has a number of aggregating functions that reduce the dimension of the grouped object. In this post will examples of using 13 aggregating function […]

Filed Under: Pandas 101, Pandas Groupby, Pandas Groupby Aggregating Functions, Python Tips Tagged With: Pandas aggregating functions, Pandas Groupby Aggregating Functions, pandas groupby()

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • Interim pages omitted …
  • Page 20
  • Go to Next Page »

Primary Sidebar

Subscribe to Python and R Tips and Learn Data Science

Learn Pandas in Python and Tidyverse in R

Tags

Altair Basic NumPy Book Review Data Science Data Science Books Data Science Resources Data Science Roundup Data Visualization Dimensionality Reduction Dropbox Dropbox Free Space Dropbox Tips Emacs Emacs Tips ggplot2 Linux Commands Linux Tips Mac Os X Tips Maximum Likelihood Estimation in R MLE in R NumPy Pandas Pandas 101 Pandas Dataframe Pandas Data Frame pandas groupby() Pandas select columns Pandas select_dtypes Python Python 3 Python Boxplot Python Tips R rstats R Tips Seaborn Seaborn Boxplot Seaborn Catplot Shell Scripting Sparse Matrix in Python tidy evaluation tidyverse tidyverse 101 Vim Vim Tips

RSS RSS

  • How to convert row names to a column in Pandas
  • How to resize an image with PyTorch
  • Fashion-MNIST data from PyTorch
  • Pandas case_when() with multiple examples
  • An Introduction to Statistical Learning: with Applications in Python Is Here
  • 10 Tips to customize ggplot2 title text
  • 8 Plot types with Matplotlib in Python
  • PCA on S&P 500 Stock Return Data
  • Linear Regression with Matrix Decomposition Methods
  • Numpy’s random choice() function

Copyright © 2026 · Lifestyle Pro on Genesis Framework · WordPress · Log in

Go to mobile version