[bug]read multiple csv files error

Open
#3,472 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by reproducing the reported Python snippet using iread, rbind, and to_pandas with representative CSV files, comparing behavior with and without the columns argument. Investigate the differing column types and the empty result, then verify that the issue's expected outcome—a pandas dataframe or clear conversion guidance—is met.

Written by the indexing model from the issue text.

Description

  • Did you find a bug in datatable, or maybe the bug found you?
    Tell us what it is.

  • How to reproduce the bug?
    This part is the most important. Please provide a code snippet which, when
    executed in console, demonstrates the problem. If necessary, attach any data
    files to the issue.

from datatable import iread, rbind

sel_cols = ['c1', 'c2', 'c3', 'c4']
files = ["/data/" + str(f) + ".csv" for f in df_site['station_id'].tolist()]
dt_data = iread(files, columns=sel_cols, errors='ignore')
# error 1: if add 'columns' params to iread, then output is empty
dt_all = rbind(dt_data, force=True)
df_data = dt_all.to_pandas()
# error 2: if not add 'columns', then it throws error: Cannot rbind column of type str32 to a column of type int32

  • What was the expected behavior?
    In case it is not obvious, please tell us what result should your code
    produce.

it must be return a pandas dataframe, or give me some advice how to convert int32 to str32?

  • Your environment?
    What is your datatable version, python version, and operating system?

centos 7
python 3.8
datatable 1.0

  • Tag the issue with [bug] or [segfault] (depending on whether it crashes
    Python or not).

  • Thank you for contributing, and sorry for the inconvenience.

Dominant language
C++
Stars
1.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from h2oai/datatable

All issues in h2oai/datatable

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.