<jupyter_start><jupyter_text>Load Data<jupyter_code># Load car loan data into a pandas dataframe from a csv file
filename = 'data/table_i702t60.csv'
df = pd.read_csv(filename)
# View the first 5 rows of the dataframe
df.head()
# Checking to make sure we dont have nans in our dataframe
# It is not easy to directly plot data that contains nans
df.info()
# For this notebook we will graph interest_paid, principal_paid, and month on one graph
# While we could graph directly through pandas, we will graph through matplotlib for now.
month_number = df.loc[:, 'month'].values
interest_paid = df.loc[:, 'interest_paid'].values
principal_paid = df.loc[:, 'principal_paid'].values
month_number
# The values attribute converts a column of values into a numpy array
type(month_number)<jupyter_output><empty_output><jupyter_text>Setting plot titles, labels, and limits  MATLAB-style<jupyter_code>plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')<jupyter_output><empty_output><jupyter_text>Set xlim and ylim<jupyter_code># This isn't the most practical use of changing ylim
plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')
plt.xlim(left=1,right=70)
plt.ylim(bottom=0,top=1000)<jupyter_output><empty_output><jupyter_text>Set xlabel and ylabel<jupyter_code># Obviously this isnt the most practical use of changing xlim and ylim
plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')
plt.xlabel('Month')
plt.ylabel('Dollars')<jupyter_output><empty_output><jupyter_text>Set Title<jupyter_code>plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')
plt.xlabel('Month')
plt.ylabel('Dollars')
plt.title('Interest and Principal Paid Each Month')<jupyter_output><empty_output><jupyter_text>Changing Fontsize<jupyter_code>plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')
plt.xlabel('Month', fontsize = 15)
plt.ylabel('Dollars', fontsize = 15)
plt.title('Interest and Principal Paid Each Month', fontsize = 15)
# Changing tick font size
plt.plot(month_number, interest_paid, c= 'k')
plt.plot(month_number, principal_paid, c = 'b')
plt.xlabel('Month', fontsize = 15)
plt.ylabel('Dollars', fontsize = 15)
plt.title('Interest and Principal Paid Each Month', fontsize = 15)
plt.xticks(fontsize = 15)
plt.yticks(fontsize = 15)<jupyter_output><empty_output><jupyter_text>Object-oriented<jupyter_code>fig, axes = plt.subplots(nrows = 1, ncols = 1)
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');<jupyter_output><empty_output><jupyter_text>Set xlim and ylim<jupyter_code>fig, axes = plt.subplots(nrows = 1, ncols = 1)
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');
axes.set_xlim(left =1 , right = 70)
axes.set_ylim(bottom = 0, top = 1000)<jupyter_output><empty_output><jupyter_text>Set xlabel and ylabel<jupyter_code>fig, axes = plt.subplots(nrows = 1, ncols = 1)
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');
axes.set_xlabel('Month')
axes.set_ylabel('Dollars')<jupyter_output><empty_output><jupyter_text>Set title<jupyter_code>fig, axes = plt.subplots(nrows = 1, ncols = 1);
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');
axes.set_xlabel('Month');
axes.set_ylabel('Dollars');
axes.set_title('Interest and Principal Paid Each Month');<jupyter_output><empty_output><jupyter_text>Changing Fontsize<jupyter_code>fig, axes = plt.subplots(nrows = 1, ncols = 1);
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');
axes.set_xlabel('Month', fontsize = 22);
axes.set_ylabel('Dollars', fontsize = 22);
axes.set_title('Interest and Principal Paid Each Month', fontsize = 22);
# Changing tick font size
fig, axes = plt.subplots(nrows = 1, ncols = 1);
axes.plot(month_number, interest_paid, c= 'k');
axes.plot(month_number, principal_paid, c = 'b');
axes.set_xlabel('Month', fontsize = 22);
axes.set_ylabel('Dollars', fontsize = 22);
axes.set_title('Interest and Principal Paid Each Month', fontsize = 22);
axes.tick_params(axis = 'x', labelsize = 20)
axes.tick_params(axis = 'y', labelsize = 20)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13802622498274672, 'fraction_numerical': 0.01518288474810214, 'mean_word_length': 7.475633528265107, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '559201', 'license': 'MIT', 'n_tokens_mistral': 1711, 'n_tokens_neox': 1569, 'n_words': 373, 'path': 'Introduction/hewei-material/6.Reporting_Virtualization/4.TitlesLabelsLimits.ipynb', 'repo_name': 'starswish2100/pythoninfinance', 'size': '4347'}