3

Pandas For Beginners — Must Know Functions — Part 1

 9 months ago
source link: https://ujjwal-dalmia.medium.com/pandas-for-beginners-must-know-functions-part-1-7b8c49f41ef4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Pandas For Beginners — Must Know Functions — Part 1

Cool hacks to quickly summarize your data using Pandas.

0*5WbFSsBqh5ZUDBQd

Photo by Xavi Cabrera on Unsplash

Every data scientist, when working on an analytical project, first tries to understand the data. By understanding, we mean: generating summary statistics, identifying the cardinality of categorical variables, and creating crosstabs. In this tutorial, we will look at the most commonly used Pandas functions which analysts use to gain data insights.

Assumption and Recommendation

Being hands-on is the key to master programming. We recommend that you continue to implement the codes as you follow through with the tutorial. The sample data and the associated Jupiter notebook is available in the Scenario_16 folder of this GitHub link.

If you are new to GitHub and want to learn it, please go through this tutorial. To set up a new Python environment on your system, please go through this tutorial.

Following is the list of Python concepts and pandas functions/ methods used in the tutorial:

Pandas functions

  • read_csv
  • crosstab
  • describe
  • value_counts

Solution

Step 1 — Keeping the data ready

For this tutorial, we are using the famous cars dataset. The dictionary for this data set and the sample data snapshot is as follows:

  • Model — Name of car model
  • Actual MPG — Mileage of the car model
  • Cylinders — # of cylinders in the car model
  • Horsepower — Power of the car model
  • Weight — Weight of the car model
  • Year — Year of manufacturing
  • Origin — Country of manufacturing
0*YBVbt3S9-QWZoRPd.png

Sample Data Snapshot (Image by Author)

Step 2 — Importing pandas package and the data set in Python.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK