How to design a grocery app in 7 simple steps

A lot of our users create ecommerce apps in Justinmind. It’s no surprise. Getting them right can be difficult but they’re really useful practice for designers. Ecommerce is an interesting area in UX…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Statistical Analysis in Python using Pandas

In the next few minutes, we shall get ‘Pandas’ covered — An extremely popular Python library that comes with high-level data structures and a wide range of tools for data analysis that every Machine Learning practitioner must be familiar with!

Image Source: Pinterest

When you see data displayed in the above format, you’re dealing with a Pandas Series object, not a dataframe object.

The following is a summary of the 3 data structures in Pandas:

Notice the slight difference in that iloc is exclusive of the second number, while loc is inclusive.

Below is an example of how you can use loc to achieve the same task as we did previously with iloc.

Now, let’s say we want to find all of the rows that satisfy a particular condition.

Another important function in Pandas is groupby(). This is a function that allows you to group entries by certain attributes (e.g Grouping entries by Wteam number) and then perform operations on them.

The next command groups all the games with the same Wteam number and finds where how many times that specific team won at home, on the road, or at a neutral site.

In order to iterate through dataframes, we can use the iterrows() function. Below is an example of what the first two rows look like.

The bracket indexing operator is one way to extract certain columns from a dataframe.

The following isnull function will figure out if there are any missing values in the dataframe, and will then sum up the total for each column.

As you probably know, Kaggle competitions require you to create a CSV of your predictions. Here’s some starter code that can help you create that csv file.

Do check out my GitHub Repositories for more implementations using Pandas —

Add a comment

Related posts:

Bonsai

Thoughts fleeing the mind. “Bonsai” is published by Randy Shingler in Haiku Hub.