问答交流

读分钟数据很容易导致内存溢出

由android1898创建,最终由small_q 被浏览 18 用户

就读几天的分钟数据,我用8G的FAI或者用2C/8G AI Studio就把内存读爆了。是不是读数据有啥BUG?

代码如下:

import dai

dayStart = "2022-12-22" dayEnd = "2023-12-31" sql = f"""FROM cn_stock_bar1m WHERE date >= '{dayStart} 09:30:00' AND date <= '{dayEnd} 15:00:00'""" df = dai.query(sql).df()



\

标签

金融数据数据处理
评论
  • \ import numpy as np from bigdatasource.api import DataSource import pandas as pd import dai import fai import datetime fai.init(cluster="fai-android1898-jhwlalta.fai-cluster",token="G2j85skSRNtzP9nmwfOo4reO9f6Hl29L") \ @fai.remote def read_daily_data():import dai ``` dayStart = "2022-12-22" dayEnd = "2023-12-31" sql = f"""FROM cn_stock_bar1m WHERE date >= '{dayStart} 09:30:00' AND date <= '{dayEnd} 15:00:00'""" df = dai.query(sql).df() print(ok) return df ``` \#run_cmjb() read_daily_data.remote() \ \ ![{w:100}](/wiki/api/attachments.redirect?id=0e01705a-0c75-45bc-8d52-30eceefc04c2)
{link}