November 2017
Beginner to intermediate
204 pages
5h 23m
English
In this next demonstration, you will approach the same problem of enumerating the road length--this time using pandas. To start off with, create a file called pandas_intro.py that import the pandas module as follows:
import pandas
Reading CSV data using the pandas module is quite simple. Pandas combines the process of opening a file with the process of reading and parsing the data. To read a CSV file using the pandas module, you can use the pandas.read_csv() function. The pandas.read_csv() function takes as input the path to a file and returns a pandas dataframe. In the following continuation of pandas_intro.py, the pandas.read_csv() function is used to read the data from artificial_roads_by_region.csv ...
Read now
Unlock full access