Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dios
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM
dios
Commits
6379b478
Commit
6379b478
authored
5 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
damn pandas revert bugfixes
parent
1f7332de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dios/dios.py
+3
-7
3 additions, 7 deletions
dios/dios.py
test/test__getitem__.py
+1
-0
1 addition, 0 deletions
test/test__getitem__.py
test/test_df_like.py
+1
-0
1 addition, 0 deletions
test/test_df_like.py
with
5 additions
and
7 deletions
dios/dios.py
+
3
−
7
View file @
6379b478
...
...
@@ -63,8 +63,6 @@ class DictOfSeries:
- ``dios.loc[..]`` loc[cation] based indexing, work on row and/or columns `labels`, align, return dios
- ``dios.iloc[..]`` i[nteger]loc[cation] based indexing, work on row and/or columns, align, return dios
Todos:
-----
"""
def
__init__
(
self
,
data
=
None
,
columns
=
None
,
itype
=
MixedItype
,
downcast_policy
=
'
save
'
):
...
...
@@ -192,9 +190,7 @@ class DictOfSeries:
new
=
self
.
copy_empty
(
columns
=
False
)
for
k
in
self
.
columns
:
# bug-fix: must be .loc, simple
# ser[key] may work positional!
new
.
_data
.
at
[
k
]
=
self
.
_data
.
at
[
k
].
loc
[
key
]
new
.
_data
.
at
[
k
]
=
self
.
_data
.
at
[
k
][
key
]
return
new
def
_getitem_bool_dios
(
self
,
key
):
...
...
@@ -209,7 +205,7 @@ class DictOfSeries:
raise
ValueError
(
"
Must pass DictOfSeries with boolean values only
"
)
# align rows
idx
=
boolser
[
boolser
].
index
.
intersection
(
ser
.
index
)
new
.
_data
.
at
[
k
]
=
ser
.
loc
[
idx
]
new
.
_data
.
at
[
k
]
=
ser
[
idx
]
return
new
def
_getitem_bool_listlike
(
self
,
key
):
...
...
@@ -239,7 +235,7 @@ class DictOfSeries:
for
k
in
data
.
columns
:
s
=
data
.
_data
.
at
[
k
]
s
[:]
=
value
self
.
_data
.
at
[
k
]
.
loc
[
s
.
index
]
=
s
self
.
_data
.
at
[
k
][
s
.
index
]
=
s
def
_setitem_dios
(
self
,
data
,
value
):
keys
=
self
.
columns
.
intersection
(
data
.
columns
)
...
...
This diff is collapsed.
Click to expand it.
test/test__getitem__.py
+
1
−
0
View file @
6379b478
from
dios
import
*
from
test.test_setup
import
*
from
pandas.core.dtypes.common
import
is_scalar
# s1 = pd.Series(range(10), index=range(10))
# s2 = pd.Series(range(5, 10), index=range(5, 10))
...
...
This diff is collapsed.
Click to expand it.
test/test_df_like.py
+
1
−
0
View file @
6379b478
...
...
@@ -3,6 +3,7 @@ import pytest
from
dios
import
*
import
pandas
as
pd
from
pandas.core.dtypes.common
import
is_dict_like
,
is_nested_list_like
import
numpy
as
np
from
copy
import
deepcopy
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment