Skip to content

Commit

Permalink
numpy was truncating the 4th character off of the string array.
Browse files Browse the repository at this point in the history
this is probably a cleaner way of doing this anyway since the string had already been cleaned
  • Loading branch information
ericsomdahl committed Oct 22, 2014
1 parent b976400 commit a4d1f8d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions HW3/simulate/order_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ def markup_with_datetime_ordinal(na_in):
return {'ordinal': dt_in.toordinal(), 'trade': na_in}


def cleanup_csv_string(na_in):
#clean up input. It may have mixed case or leading/trailing spaces
return na_in['symbol'][0].strip().upper()


class OrdersInput(object):
def __init__(self, csv_file):
self.csv_file = csv_file
Expand All @@ -44,7 +39,7 @@ def internal_init(self):
self.na_trade_dates.sort()

#create an array of all of the symbols. There will be repeats
self.na_symbols = np.apply_along_axis(cleanup_csv_string, 0, self.na_raw_orders)
self.na_symbols = self.na_raw_orders['symbol']
#remove dupes
self.na_symbols = np.unique(self.na_symbols)

Expand Down

0 comments on commit a4d1f8d

Please sign in to comment.