• 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
  • Conferences
  • Python Books
  • About
    • Privacy Policy
You are here: Home / Archives for Pandas 101

Pandas 101

How to Convert Wide Dataframe to Tidy Dataframe with Pandas stack()?

June 9, 2020 by cmdlinetips

Data in wide form is often easy to read for human eyes. However, you might need data in tidy/long form for data analysis. In Pandas there are a few ways to reshape a dataframe in wide form to a dataframe in long/tidy form. In this post we will see a simple example of converting a […]

Filed Under: Pandas 101, Pandas Stack, Pandas Stack Tagged With: Pandas 101, Python

Pandas Groupby and Compute Mean

June 3, 2020 by cmdlinetips

One of most common use of Pandas’ groupby function is to compute some summary statistics on one or more variables in the dataframe. In this post we will see an example of how to compute mean on all numerical variables and a select variable after groupby operation. Let us first load Pandas package. We will […]

Filed Under: Pandas 101 Tagged With: Pandas 101, Python

Getting Started with Pandas Groupby

May 27, 2020 by cmdlinetips

Pandas Groupby

Pandas groupby function is one of the most useful functions enabling a bunch of data munging activities. A simple use case of groupby function is that we can group a bigger dataframe by a single variable in the dataframe into multiple smaller dataframes. Typically, after grouping by a variable, we perform some computations on each […]

Filed Under: Pandas 101, Pandas Groupby Tagged With: Pandas 101

How To Add Identifier Column When Concatenating Pandas data frames?

May 22, 2020 by cmdlinetips

Pandas concat() function is great for concating two data frames or appending one dataframe to another with same columns. Sometimes, you might want to keep an identifier for each appended dataframe. In this post, we will see an example of how to concat two dataframes with an identifier. Let us import Pandas and numpy to […]

Filed Under: Pandas 101 Tagged With: Pandas 101

How To Save Pandas Dataframe as Excel File?

May 9, 2020 by cmdlinetips

In this post, we will see examples of saving a Pandas dataframe as Excel file. Pandas has to_excel() function to write a dataframe into Excel file. Let us load Pandas. We will create two lists and us these to create a dataframe as before. We can create a Pandas dataframe using the two lists to […]

Filed Under: Pandas 101 Tagged With: Python

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Interim pages omitted …
  • Page 13
  • 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 © 2025 · Lifestyle Pro on Genesis Framework · WordPress · Log in

Go to mobile version