获取1分钟线

        :param symbol:
        :return: pd.dataFrame or None
423237
def minute(self, symbol=None):
        '''
        
        '''
        symbol = self.find_path(symbol, subdir='minline', ext=['lc1', '1'])
        reader = TdxLCMinBarReader()

        if symbol is not None:
            return reader.get_df(symbol)

        return None
470788
def select(cls, symbol, start_date, end_date):
        """"""
        instance = cls(symbol, start_date, end_date)

        return instance.data
53398
def descriptor_for_symbol(self, symbol):
        
        if isinstance(symbol, basestring):
            symbol = sympy.Symbol(symbol)

        try:
            return self._descriptions_dict[symbol]
        except KeyError:
            raise KeyError("Symbol {0!r} not found in left-hand-side of the equations".format(symbol))
1016640
def symbol(self, ident, bp=0):
        '''
        
        '''
        try:
            s = self.symbols[ident]
        except KeyError:
            class s(SymbolBase):
                pass
            s.__name__ = 'symbol-%s' % (ident,)
            s.ident = ident
            s.lbp = bp
            self.symbols[ident] = s
        else:
            s.lbp = max(bp, s.lbp)
        return s
1073138
def get_atom_type_symbol(cls,calc,**kwargs):
        
        parameters = calc.out.output
        dictionary = parameters.get_dict()
        if 'basis_set' not in dictionary.keys():
            return None
        return sorted(dictionary['basis_set'].keys())
57460
def company_category(self, symbol=''):
        '''
        
        '''
        market = get_stock_market(symbol)

        with self.client.connect(*self.bestip):
            data = self.client.get_company_info_category(int(market), symbol)
            return self.client.to_df(data)
51965
def _pandas_interp(self, data, indices):
        
        new_index = np.arange(indices[-1] + 1)

        data_frame = DataFrame(data, index=indices)
        data_frame_reindexed = data_frame.reindex(new_index)
        data_interpol = data_frame_reindexed.apply(Series.interpolate)

        del new_index
        del data_frame
        del data_frame_reindexed

        return data_interpol
1009999
def symbol_bollinger(symbol='GOOG',
    start=datetime.datetime(2008, 1, 1), end=datetime.datetime(2009, 12, 31), price_type='close', cleaner=clean_dataframe,
    window=20, sigma=1.):
    
    symbols = normalize_symbols(symbol)
    prices = price_dataframe(symbols, start=start, end=end, price_type=price_type, cleaner=cleaner)
    return series_bollinger(prices[symbols[0]], window=window, sigma=sigma, plot=False)
1371436
def dataframe(self):
        
        temp_index = self._index
        rows = []
        indices = []
        if not self._season:
            return None
        for season in self._season:
            self._index = self._season.index(season)
            rows.append(self._dataframe_fields())
            indices.append(season)
        self._index = temp_index
        return pd.DataFrame(rows, index=[indices])
988890
def get_price(self, **kwargs):
        
        def fmt_p(out):
            return pd.DataFrame(out, index=self.symbols)

        return self._get_endpoint("price", fmt_p=fmt_p, params=kwargs)
1063343
def read_tuple_ticks(self, symbol, start, end):
        '''  '''
        if end is None:
            end=sys.maxint

        session=self.getReadSession()()
        try:
            rows=session.query(Tick).filter(and_(Tick.symbol == symbol,
                                                      Tick.time >= int(start),
                                                      Tick.time < int(end)))
        finally:
            self.getReadSession().remove()

        return [self.__sqlToTupleTick(row) for row in rows]
442834
def evaluate(self, verbose=True, passes=None):
        
        i = 0
        exprs = []
        for column_name in self.column_names:
            if len(self.column_names) > 1:
                index = "1.$%d" % i
            else:
                index = "1"
            expr = self.get_column(
                column_name,
                self.column_types[i],
                index,
                verbose=verbose
            )
            i += 1
            exprs.append(expr)

        i = 0
        for column_name in self.grouping_column_name:
            if len(self.grouping_column_name) > 1:
                index = "0.$%d" % i
            else:
                index = "0"
            expr = self.get_column(
                column_name,
                self.grouping_column_types[i],
                index,
                verbose=verbose
            )
            exprs.append(expr)
            i += 1

        result = utils.group(exprs).evaluate(verbose=verbose, passes=passes)
        df = pd.DataFrame(columns=[])
        all_columns = self.column_names + self.grouping_column_name
        for i, column_name in enumerate(all_columns):
            df[column_name] = result[i]
        return dataframeweld.DataFrameWeld(df)
840220
def xdxr(self, symbol=''):
        '''
        
        '''
        market = get_stock_market(symbol)

        with self.client.connect(*self.bestip):
            data = self.client.get_xdxr_info(int(market), symbol)
            return self.client.to_df(data)
205860
def find_column(self, token):
        
        i = token.lexpos
        while i > 0:
            if self.input_data[i - 1] == '\n':
                break
            i -= 1

        column = token.lexpos - i + 1
        return column
688925
def _get_processed_dataframe(self, dataframe):
        
        dataframe.index = pd.to_datetime(dataframe['epoch'], unit='s', utc=True)
        del dataframe['epoch']
        summary = dataframe.describe(percentiles=[.80, .90, .95]).transpose().loc['scriptrun_time']
        df_grp = dataframe.groupby(pd.TimeGrouper('{}S'.format(self.interval)))
        df_final = df_grp.apply(lambda x: x.describe(percentiles=[.80, .90, .95])['scriptrun_time'])

        return {
            "raw": dataframe.round(2),
            "compiled": df_final.round(2),
            "summary": summary.round(2)
        }
214595
def today(self, symbol):
        

        data = self._get(self.url_for(PATH_TODAY, (symbol)))

        # convert all values to floats
        return self._convert_to_floats(data)
497460
def dataframe(self):
        """"""
        data = self.data
        channel_names = self.get_channel_names()
        return pd.DataFrame(data, columns=channel_names)