A primer on Pandas.
Ashwin Nalwade.
-
Read a CSV file
pd.read_csv(file_path)
-
Read an excel file
pd.read_excel(file_path)
-
Read a table [.dat]
pd.read_table(file path, delim_whitespace=True)
Used to quantify non-numeric categorical variables.
df_dummy = pd.get_dummies[df['column_name']]
# check
df_dummy.head()
concat()
is used for appending dataframes. We can append across columnsset axis = 1
or across rowsset axis = 0
.merge()
is used for combining dataframes on the basis of data stored in common columns.join()
is used for merging dataframes on the basis of index.