activeloopai / activeloopai/deeplake

[FEATURE] single-CSV auto ingestion

Đang mở
#1,377 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
C++
Star
9.2k
Fork
722
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## 🚨🚨 Feature Request

Related to #1156 (this issue is a building block to it)

## Description

build the implementation of the API:
```python
ds = ... # create dataset

"""
columns/structure of the file found at: "path/to/file.csv"

--------------------
col1, col2, col3
"text", 1, 5
"another_text", 1, 5.5
"""

ds.ingest("path/to/file.csv")

assert ds.col1.data() == ["text", "another_text"]
assert ds.col2.numpy(as_list=True) == [1, 1]
assert ds.col3.numpy(as_list=True) == [1, 5.5]

assert len(ds) == 2 # num rows
```

#1156 is the feature to support a directory of CSV files, but a single CSV file is sufficient for now.

## Solution
you can probably use pandas to read the CSV file and then create one tensor per column. set the dtype for each column as the dtype found in pandas for that column. the htype can only be determined for text for now. in the future, we would want to infer htypes but now it isn't required.

i would create a **new subdirectory + file** under [here](https://github.com/activeloopai/Hub/tree/main/hub/auto) called "structured/csv.py" and implement your code there, and following the same code structure as the unstructured classes found [here](https://github.com/activeloopai/Hub/tree/main/hub/auto/unstructured).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.