Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
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-software
SaQC
Merge requests
!666
Draft: auto cast data index
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: auto cast data index
auto-datetime
into
develop
Overview
0
Commits
1
Pipelines
1
Changes
1
Closed
David Schäfer
requested to merge
auto-datetime
into
develop
2 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Addresses
#374 (closed)
BTW, MR 666
😨
Edited
2 years ago
by
David Schäfer
👍
0
👎
0
Merge request reports
Compare
develop
version 2
98dd96e2
1 year ago
version 1
98dd96e2
2 years ago
develop (base)
and
latest version
latest version
98dd96e2
1 commit,
1 year ago
version 2
98dd96e2
1 commit,
1 year ago
version 1
98dd96e2
1 commit,
2 years ago
1 file
+
11
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
saqc/core/core.py
+
11
−
1
Options
@@ -14,6 +14,7 @@ from typing import Any, Hashable, MutableMapping
import
numpy
as
np
import
pandas
as
pd
from
pandas.errors
import
ParserError
from
saqc.core.flags
import
Flags
,
initFlagsLike
from
saqc.core.frame
import
DictOfSeries
@@ -153,6 +154,7 @@ class SaQC(FunctionsMixin):
def
_initData
(
self
,
data
)
->
DictOfSeries
:
if
data
is
None
:
return
DictOfSeries
()
if
isinstance
(
data
,
list
):
result
=
DictOfSeries
()
doubles
=
pd
.
Index
([])
@@ -191,10 +193,18 @@ class SaQC(FunctionsMixin):
raise
ValueError
(
"'
data
'
should not have MultiIndex
"
)
try
:
# This ensures that values are pd.Series
return
DictOfSeries
(
data
)
data
=
DictOfSeries
(
data
)
except
Exception
:
raise
TypeError
(
f
"
Cannot cast
{
type
(
data
)
}
to DictOfSeries
"
)
from
None
for
key
in
data
.
keys
():
try
:
data
[
key
].
index
=
pd
.
to_datetime
(
data
[
key
].
index
)
except
(
ParserError
,
ValueError
)
as
e
:
raise
ValueError
(
f
"
Could not cast index of
'
{
key
}
'
to type pd.Dateime, please do this manually.
"
)
from
e
def
_initFlags
(
self
,
flags
)
->
Flags
:
if
flags
is
None
:
return
initFlagsLike
(
self
.
_data
)
Loading