import numpy as np  # get numpy package
data = np.genfromtxt(fname='breakout_data.csv', # data filename
              dtype=None,  # figure out the data type by column
              delimiter=',',  # delimit on commas
              names=True,  # first line contains column namesh
             )

"""
Explanation: Spartanburg Breakout Data Set
Analysis with Machine-Learning, SK-Learn, and Python
Data Preparation
Our data is in a file called "breakout_data.csv"
We'll use python to grab it and process it into a usable numpy array
End of explanation
"""


column_headers = data.dtype.names
print(column_headers)  # print the column headers
print('Number of columns: {}'.format(len(column_headers)))

"""
Explanation: Now our data is in a nice numpy ndarray.  We can access it using the numpy methods.  For example:
We can print the headers and the number of columns...
End of explanation
"""


print('The first row of data is: \n{}'.format(data[0]))  # print the first row
print('\n')  # print a blank line
print('and the last row of data is: \n{}'.format(data[len(data)-1]))  # print the last row

"""
Explanation: We can also print specific rows of data...
End of explanation
"""


