Import packages that use to work with in a ML/AI projects
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inlinepd.__version__
We have the read_csv the Pandas and record on the df object:
df = pd.read_csv('path_to_csv_file.csv')
We can see the DataFrame type
print(type(df))<class'pandas.core.frame.DataFrame'>
The first column is the index created automatically by Pandas, the other columns were collected from the dataset loaded.
df.head(10)
Let’s see how Pandas determined the types of each column when loading them
df.dtypes
Returns a list of columns we have
df.columns
Adjust the name of the columns of the dataframe.
cols = ['col1', 'col2', 'col3']
df.columns = cols # columns receive cols
Starts at 0 and ends at 81, jumping 1 in 1.
df.index
RangeIndex(start=0, stop=81, step=1)