Changig column classes is slow.

Đang mở
#2,138 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r
Lĩnh vực
performance

Hướng nghiên cứu

Start by benchmarking the reported mydata[, names(mydata) := lapply(.SD, as.character)] operation against fread(..., colClasses=list(character=1:3775)) on similarly large mixed-type data. Trace the column-class conversion path and measure whether an alternative or improvement avoids the reported slowdown; done means faster conversion with results equivalent to the current method.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

performance

I'm working with large datasets (around 4GB), mixing dates, numbers and factors.

And I want to perform operations such as changing all column classes to character.

mydata[, names(mydata) := lapply(.SD, as.character)]

But it's quite slow.

If you just had the data on the disk and reload it with
my <- fread("mydata.csv", stringsAsFactors=F, colClasses=list(character=1:3775))

it's much faster.

Is there alternative to the first method?
Or maybe it could be improved in some way.

Ngôn ngữ chính
R
Star
3.9k
Fork
1.1k
Merge trung bình
14 giờ 4 phút
Pull request đã merge (30 ngày)
4

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Rdatatable/data.table

Tất cả issue của Rdatatable/data.table

Issue tương tự

Thêm issue về R

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.