• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
  • Contact
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

3 Tricks to Sharpen Your Pandas Skills

February 1, 2021 by systems

2. Sidetable

The second trick involves a third party package called Sidetable which was created by Chris Moffitt.

We first need to install it.

$  python -m pip install -U sidetable #from terminal!pip install sidetable #jupyter notebook

We can now import and start using it. Once imported, it can be used as an accessor on dataframes like str and dt accessors.

import sidetable

Sidetable has 4 different functions one of which is the freq function. It returns three pieces of information about a given column:

  • The number of observations (i.e. rows) for each value in the column (value_counts()).
  • The percentage of each value in the entire column (value_counts(normalize=True)).
  • The cumulative versions of the two above.

Let’s apply it on the age column.

import sidetabledf.stb.freq(['Age'])
(image by author)

The freq function counts the number of rows by default. If we pass another column using the value parameter, it will return the sum of values in that column.

df.stb.freq(['Age'], value = 'AmountSpent')
(image by author)

Sidetable provides three more functions. Here is a more detailed article about sidetable if you’d like read further.

Filed Under: Artificial Intelligence

Primary Sidebar

Stay Ahead: The Latest Tech News and Innovations

Cryptocurrency Market Updates: What’s Happening Now

Emerging Trends in Artificial Intelligence: What to Watch For

Top Cloud Computing Services to Secure Your Data

The Future of Mobile Technology: Recent Advancements and Predictions

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2025 NEO Share

Terms and Conditions - Privacy Policy