data_analysis/analyze_data.py
def analyze_content():
	'''
	Stats about the content of the images
	'''
	df = pd.read_csv('imgs/driver_imgs_list.csv')
	columns = ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9']
	subjects = df.drop_duplicates('subject')['subject'].tolist()
	new_df = pd.DataFrame(index=subjects, columns=columns)
	classes = df.drop_duplicates('classname')['classname'].tolist()

	print("Number of drivers: %d" % len(subjects))

	for subject in subjects:
		print("Analyzing subject %s" % subject)
		subject_data = df.loc[df['subject'] == subject]
		row = []
		for class_type in classes:
			images_data = subject_data.loc[df['classname'] == class_type]
			row.append(len(images_data))
		new_df.loc[subject] = row

	print(new_df)
	print(new_df.describe().loc[['mean', 'std', 'min', 'max']])

	Stats about the content of the images
	
Stats about the content of the images
Stats about the content of the images
def analyze_content():
	df = pd.read_csv('imgs/driver_imgs_list.csv')
	columns = ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9']
	subjects = df.drop_duplicates('subject')['subject'].tolist()
	new_df = pd.DataFrame(index=subjects, columns=columns)
	classes = df.drop_duplicates('classname')['classname'].tolist()
	print("Number of drivers: %d" % len(subjects))
	for subject in subjects:
		print("Analyzing subject %s" % subject)
		subject_data = df.loc[df['subject'] == subject]
		row = []
		for class_type in classes:
			images_data = subject_data.loc[df['classname'] == class_type]
			row.append(len(images_data))
		new_df.loc[subject] = row
	print(new_df)
	print(new_df.describe().loc[['mean', 'std', 'min', 'max']])
def analyze_content ( ) : df = pd . read_csv ( 'imgs/driver_imgs_list.csv' ) columns = [ 'c0' , 'c1' , 'c2' , 'c3' , 'c4' , 'c5' , 'c6' , 'c7' , 'c8' , 'c9' ] subjects = df . drop_duplicates ( 'subject' ) [ 'subject' ] . tolist ( ) new_df = pd . DataFrame ( index = subjects , columns = columns ) classes = df . drop_duplicates ( 'classname' ) [ 'classname' ] . tolist ( ) print ( "Number of drivers: %d" % len ( subjects ) ) for subject in subjects : print ( "Analyzing subject %s" % subject ) subject_data = df . loc [ df [ 'subject' ] == subject ] row = [ ] for class_type in classes : images_data = subject_data . loc [ df [ 'classname' ] == class_type ] row . append ( len ( images_data ) ) new_df . loc [ subject ] = row print ( new_df ) print ( new_df . describe ( ) . loc [ [ 'mean' , 'std' , 'min' , 'max' ] ] )
Stats about the content of the images
Stats about the content of the images
'''
	Stats about the content of the images
	'''