Pandas read large file read_table c-engine cparsererror:error tokenizing data

Source: Internet
Author: User

Workaround:

Pd_data = pd.read_table (comment_file,header=none,encoding='utf-8', engine=' python ')

Official website Analysis:

engine : {' C ', ' Python '}, optional

Parser engine to use. The C engine was faster while the Python engine was currently more feature-complete.

 

1,

iterator  : boolean, default False

Return Textfilereader object for iteration or getting chunks With get_chunk () .

or get

from Chunk
 pd_data = pd.read_table (comment_file,header=none,encoding= ' utf-8 ', iterator=true) 
# Print (pd_data)
# Pd_ data_t = pd.read_table (comment_file,header=none,encoding= ' utf-8 ', engine= ' python ')
# return;
loop = True
Chunk_data = []
Chunk_size = 1024x768
While loop:
Try:
pd_data_tmp = Pd_data.get_chunk (chu nk_size)
Chunk_data.append (pd_data_tmp)
except stopiteration:
loop = False
df = pd.concat (chunk _data,ignore_index=true)

Pandas read large file read_table c-engine cparsererror:error tokenizing data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.