# 8.40:  Set the dtype for a column.  First, use .dtypes to show the column types.  You may use
# .unique() to determine the range of values for the 'transactions' column, which explains why tahat
# column is type object.

# Next, replace the '-' values in the 'transactions' column with 0's, then again check the .dtypes
# (and use .unique() if you wish.
# 
# Finally, use .astype() to set the column dtype to 'int', then check the .dtypes again.

import pandas as pd

df = pd.read_csv('../revenue_extended.csv', skiprows=2,
                                            skipfooter=2,
                                            engine='python')

print(df.dtypes)


print(df.transactions.unique())

df.transactions = df.transactions.replace('-', 0)

df.transactions = df.transactions.astype(int)

print(df.dtypes)

