-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate (Sparse) XArray Sizes depending on Dimensions #8
Comments
@iamsiddhantsahu, until tomorrow (23.01.2024) please investigate: Currently, the The input data is formatted in JSON (cf. the "7-2000-converter mass": {
"name": "converter mass",
"year": 2000,
"powertrain": [
"PHEV-c-d",
"PHEV-e",
"BEV",
"FCEV",
"PHEV-c-p"
],
"sizes": [
"Mini",
"Small",
"Lower medium",
"Medium",
"Large",
"Van",
"Medium SUV",
"Large SUV",
"Micro"
],
"amount": 4.5,
"loc": 4.5,
"minimum": 4,
"maximum": 6,
"kind": "distribution",
"uncertainty_type": 5,
"category": "Powertrain",
"source": "Del Duce et al (2016)",
"comment": ""
}, Of course, we could represent this in tabulated format also:
In the instantiation of the
(where This array is then used further on in the From what I can see, data is extracted from the ...so why can't we do this with a Pandas DataFrame? |
I wrote a script b218c47 to test the memory usage and slicing times comparing Pandas and XArray with sparse arrays. Findings:
|
Also, you still have to think about the utility of using an |
The pandas.DataFrame.to_xarray() function that you are using here, converts a pandas.DataFrame object to a xarray.Dataset object. And, the |
Here is a bar plot comparing the memory usage of Pandas's pandas.DataFrame object and XArrays's xarray.Dataset object. Dataset 1 = Findings: |
Try:
4 dimensions (eg.
parameter
,time
,size
,prop
)8 dimensions (eg.
parameter
,time
,size
,prop1
,prop2
,prop3
,prop4
,prop5
)and determine size (in memory) and performance when eg. slicing the array.
See also:
The text was updated successfully, but these errors were encountered: