How to install Jupyter notebook and pandas on mobile android ios. Basic data analysis on phone

preview_player
Показать описание
Basic Data Analysis operations using Pandas.

1. View names of columns in a table.

To view the names of columns on a table such as an excel file, use the command;

Let's say we have an excel file with 2 column names ; "state" and "city".

[ "State", "City"]

2. Number of rows

To check the number of rows in an excel file, use the command ;

*len(df)*

This command will output a number, showing you the total length of the excel file.

3. Number of rows and columns

To check the number of rows and columns in an excel file; use the command ;

This will output two numbers. The first number showing the number of rows and the second number for the columns.

(20, 2).

4. Selecting a particular column

To select a particular column from your excel, use the command;

*df["column_name"]* or

Let's say we have an excel file with two columns namely ; "State" and "City", and you want to select only the State, you use the command

*df["City"] or df.City*

And it will show only data for "City".

5. Adding new columns to our table.

Using our two column table example, let's say you want to add a third column to it, use the command

*df["new_column_name"] = df["Column_1"] + df["Column_2"]*

Let's say we want to add a third column, called "State_City", to our dataframes (df), use the command

*df["State_City"] = df["State"] + df["City"]*

So you'll now have 3 columns instead of two namely:
State
City
State_City

6. Filter data based on condition

Let's say the column "State" in our dataframes has 20 data for Abuja, 10 for Lagos, 13 for Delta and 16 for Port Harcourt. And you want to view data for *Delta state only*, use this command

df[df["State"] == "Delta"]

This will produce only data belonging to Delta state.

If you have any questions, drop in the comment section.

See you in my next class.
Рекомендации по теме