-
Notifications
You must be signed in to change notification settings - Fork 891
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
[FEA] cudf.DataFrame.from_dict #11934
Comments
+1 to this feature (and to it's |
From a call with @shwina. We can already do something dict things like: In [4]: cudf.DataFrame({'a': cudf.Series([1,2,3]), 'b': cudf.Series([4,5,6], index=[9,10,11])})
Out[4]:
a b
0 1 <NA>
1 2 <NA>
2 3 <NA>
9 <NA> 4
10 <NA> 5
11 <NA> 6 Hmm, actually the DataFrame constructor is pretty robust: In [19]: cudf.DataFrame({'c': ['a', 'b', 'd'], 'b': cudf.Series([1, 2, 3]), 'd': pd.Series([10, 11, 12])})
Out[19]:
c b d
0 a 1 10
1 b 2 11
2 d 3 12
In [23]: cudf.DataFrame({'a': cudf.Series([1,2,3]), 'b': cudf.Series([4,5,6], index=[9,10,11]),'c': pd.Series(['q', 'r', 's'])})
Out[23]:
a b c
0 1 <NA> q
1 2 <NA> r
2 3 <NA> s
9 <NA> 4 <NA>
10 <NA> 5 <NA>
11 <NA> 6 <NA> @mattf can you, as a test, check if the standard constructor works for your usecase ? If so, maybe this is as easy as redirecting |
@quasiben - I also suspect that More context: The |
@quasiben the cudf.DataFrame constructor works for the specific case i have, but the most important thing is the API matches what pandas.DataFrame.from_dict provides |
@mattf Would you please provide a specific case where |
I think the problem is that there is no |
@GregoryKimball |
…12048) Resolves: #11934 - [x] Adds `DataFrame.from_dict` and `DataFrame.to_dict` - [x] Adds `Series.to_dict` Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Lawrence Mitchell (https://github.com/wence-) URL: #12048
Is your feature request related to a problem? Please describe.
rewriting code from pandas into cudf, trying to use
import cudf as pd
Describe the solution you'd like
cudf.DataFrame.from_dict
matching https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.from_dict.htmlThe text was updated successfully, but these errors were encountered: