Comments (4)
Thanks for the issue @simplew2011. We already support loading datasets from hugging face via fsspec's hf://
support (see https://docs.dask.org/en/stable/how-to/connect-to-remote-data.html). For example:
import dask.dataframe as dd
df = dd.read_parquet("hf://datasets/wikimedia/wikipedia/20231101.en")
Can you say more about what you're looking for? It could be things already work
from dask.
-
Currently, only JSONL files are support? loading JSON files is fail
- json
[ {"id": 0, "text": "https://docs.dask.org/en/latest/bag-api.html"}, {"id": 1, "text": "https://docs.dask.org/en/latest/bag-api.html"} ]
- jsonl
{"id": 0, "text": "https://docs.dask.org/en/latest/bag-api.html"} {"id": 1, "text": "https://docs.dask.org/en/latest/bag-api.html"}
import dask.bag as db b_bg = db.read_text('examples/demos/datasets.jsonl').map(json.loads) # ok b_bg1 = db.read_text('examples/demos/datasets.json').map(json.load) # fail
-
I have a usage scenario where I have already used the datasets library to load raw data (such as local JSON and JSONL files). I would like to convert it directly to dask.dataframe in memory instead of converting it to parquet first
from dask.
Currently, only JSONL files are support? loading JSON files is fail
See this related Stackoverflow question and answer https://stackoverflow.com/questions/44889526/dask-bag-jsondecodeerror-when-reading-multiline-json-arrays. In short, the read_text
function interprets every line of your file as a separate element.
I would like to convert it directly to dask.dataframe in memory instead of converting it to parquet first
Maybe you'll be better off just using Dask DataFrame's JSON reader? With data files like this:
data/0.json
:
[
{"id": 0, "text": "https://docs.dask.org/en/latest/bag-api.html"},
{"id": 1, "text": "https://docs.dask.org/en/latest/bag-api.html"}
]
data/1.json
:
[
{"id": 2, "text": "https://docs.dask.org/en/latest/bag-api.html"},
{"id": 3, "text": "https://docs.dask.org/en/latest/bag-api.html"}
]
You can read the data like this:
import dask.dataframe as dd
files = ["data/0.json", "data/1.json"]
df = dd.read_json("data/*.json", lines=False)
print(f"{df.compute() = }")
from dask.
thanks
from dask.
Related Issues (20)
- 'SeriesGroupBy' object has no attribute 'nunique_approx' HOT 6
- Categorical column information incorrectly copied over when using series to create new dataframe resulting in a broken dataframe
- calling repartition on ddf with timeseries index after resample causes ValueError: left side of old and new divisions are different
- Can not process datasets created by the older version of Dask HOT 9
- P2P rechunking of ERA-5 from spatial to temporal dimension is failing hard HOT 15
- Improve documentation for `dd.from_map(...)` HOT 1
- AssertionError: DataFrame are different with dask 2024.5.1 and python 3.12 HOT 3
- `test_quantile` flaky
- Shuffle not raising exception when `on` does not exist HOT 1
- [FEA] Add official mechanism to check if query-planning is enabled in ``dask.dataframe`` HOT 3
- UnboundLocalError in test_dt_accessor when dd._dask_expr_enabled is False HOT 2
- Error with the default tokenizer. HOT 4
- Cannot bind async delayed
- Most tests in `test_parquet.py` fail on s390x (big-endian) HOT 4
- cumsum/cumprod issue with empty partitions HOT 2
- Bug in map_blocks when iterating over multiple arrays HOT 1
- Error when processing JSONL with excluded null values using dataframe.read_json HOT 4
- Turn `fail_on_warning` in docs back on again
- 404 Not Found for "Dask distributed IPython docs" HOT 3
- Backend dispatch fails to re-raise BotoCoreError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask.