Exemple #1
0
def get_file_type(file):
	df = normalize.parse_file(file)
	column_list = [x for x in df.columns.values if not x.startswith('Unnamed:')]
	file_type = ''
	for t,l in file_types.items():
		if column_list == l:
			file_type = t

	if file_type == '':
		normalize.change_column_names(df)
		normalize.merge_zhaiyao_and_operation(df)
		if 'operation' in df.columns:
			for o in df['operation']:
				if o in [u'融资买入', u'融资利息扣款', u'融资利息']:
					file_type = 'rzrq'
			if file_type == '':
				file_type = 'normal'
		else:
			file_type = 'unknown!!!'

	return file_type