Git Product home page Git Product logo

Comments (6)

leegb avatar leegb commented on July 23, 2024 1

@yutiansut 我知道,可以自己处理,但是强迫症患者,一点计算资源也不愿浪费。

from pytdx.

yutiansut avatar yutiansut commented on July 23, 2024 1

我也觉得干掉比较好 可能是因为兼容性吧 毕竟删东西会导致别人的代码不兼容 @leegb

from pytdx.

yutiansut avatar yutiansut commented on July 23, 2024

https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py#L330
@leegb

def QA_fetch_get_stock_xdxr(code, ip=best_ip, port=7709):
    api = TdxHq_API()
    market_code = __select_market_code(code)
    with api.connect(ip, port):
        category = {
            '1': '除权除息', '2': '送配股上市', '3': '非流通股上市', '4': '未知股本变动', '5': '股本变化',
            '6': '增发新股', '7': '股份回购', '8': '增发新股上市', '9': '转配股上市', '10': '可转债上市',
            '11': '扩缩股', '12': '非流通股缩股', '13':  '送认购权证', '14': '送认沽权证'}
        data = api.to_df(api.get_xdxr_info(market_code, code))
        data = data\
            .assign(date=pd.to_datetime(data[['year', 'month', 'day']]))\
            .drop(['year', 'month', 'day'], axis=1)\
            .assign(category_meaning=data['category'].apply(lambda x: category[str(x)]))\
            .assign(code=str(code))\
            .rename(index=str, columns={'panhouliutong': 'liquidity_after',
                                        'panqianliutong': 'liquidity_before', 'houzongguben': 'shares_after',
                                        'qianzongguben': 'shares_before'})\
            .set_index('date', drop=False, inplace=False)
        return data.assign(date=data['date'].apply(lambda x: str(x)[0:10]))

可以直接洗出来

from pytdx.

yutiansut avatar yutiansut commented on July 23, 2024

一样的 程序里面处理和你自己处理 都浪费资源

from pytdx.

yutiansut avatar yutiansut commented on July 23, 2024

难道写在pytdx里面 你调用的时候就不占用你的cpu了?

from pytdx.

leegb avatar leegb commented on July 23, 2024

@yutiansut @rainx 好吧,我一般都直接在源码里把year,month,date三列都干掉了,批量处理,一旦把数据都补齐,三列数据可占用不小的内存。作者关闭吧,有更新自己改好了。

from pytdx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.