-
Notifications
You must be signed in to change notification settings - Fork 358
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
Series(data=df, index=None) seems to be incorrectly instantiated #1732
Comments
Can you share the full error message? Looks like you're running it in Windows, is it correct? |
Yes I am running it on Windows, I edited with full error message. |
@LucasG0, are you able to create a pandas DataFrame and select via |
Yes, using pandas 1.0.5. >>> df = pd.DataFrame({"a": [1, 1, 1], "b": [2, 2, 2]})
>>> df['a']
0 1
1 1
2 1
Name: a, dtype: int64
>>> df['b']
0 2
1 2
2 2
Name: b, dtype: int64 |
Actually, it fails with an index parameter too. >>> df = ks.DataFrame({"a": [1, 2, 3, 4, 5]})
>>> ser = ks.Series(df, index=df.index.to_numpy())
>>> print(ser)
Traceback (most recent call last):
File "mytest.py", line 22, in <module>
print(ser)
File "D:\Dev\koalas\databricks\koalas\series.py", line 5239, in __repr__
pser = self._kdf._get_or_create_repr_pandas_cache(max_display_count)[self.name]
File "D:\Dev\Utils\Miniconda\envs\koalas-dev\lib\site-packages\pandas\core\frame.py", line 2806, in __getitem__
indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
File "D:\Dev\Utils\Miniconda\envs\koalas-dev\lib\site-packages\pandas\core\indexing.py", line 1553, in _get_listlike_indexer
keyarr, indexer, o._get_axis_number(axis), raise_missing=raise_missing
File "D:\Dev\Utils\Miniconda\envs\koalas-dev\lib\site-packages\pandas\core\indexing.py", line 1640, in _validate_read_indexer
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Int64Index([0, 1, 2, 3, 4], dtype='int64')] are in the [columns]" |
I guess, passing |
In deed |
Ah, yeah, but actually the constructor taking |
Alright, pandas does not support it either. |
I'll tentatively resolve this ticket since pandas doesn't support either. |
Hi, I saw it is now possible to create a Series from a DataFrame without any additional index parameter.
However, I can not
print
orsort_index
a Series which has been created in this way.I guess the Series is incorrectly instantiated and probably other actions would fail too.
The text was updated successfully, but these errors were encountered: