Search

Pandas plays with data: Chapter Two

I hope you guys got the point from chapter one and now let’s start where we left

> Read only first 10 rows

By the “now” we can read rows as many as we want

> Output

In this, we read only 10 rows if you can read as much as you want

> Read only specific columns

Here I use “now” for countable data so I can show you

> Output

Here we read some specific columns

Or you can use head() also if you want to print/read-only top 5 values

> Read text file

A computer file is structured as a sequence of lines of electronic tests.

Here we read the txt file

> Output

now after the update, we use read_csv instead of read_table

> Read Excel file

These file helps to store the data in spreadsheets, which we are used to store financial data.

Here we read the file of extension .xlsx

> Output

Here we are reading the Excel file

> Read SAS files

SAS stands for Statistical Analysis Software, and contains the source code for a program.

Here we read the value of SAS file

> Output

Here is the value

Now we are going to learn how we can convert one type of data to another type of data but for this first, we have to import the os(operating system) with the help of this we are able to convert one type to another type, and for this, we have to create a folder where the converted file is stored and we also have to give its path.

In this first, we have to import the OS and os.chdir is used to change the current directory to another path and then we start to change the type of the data.

> Output

Here the os is imported

so, with these two blogs we learn some basic operations of pandas which will be very useful when you are working on the data, i hope you find it interesting and i hope you gain some knowledge through my blogs and if you want more click here.

Stay tuned with us, Thanks

Book A Free Demo Class

    Social Media
    Facebook
    Twitter
    WhatsApp
    LinkedIn