Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
HOTMapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HOTMapper
HOTMapper
Merge requests
!12
Use pandas to read header
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Use pandas to read header
change_header_reading
into
development
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
jvfpw18
requested to merge
change_header_reading
into
development
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
e15a9f4b
Show latest version
1 file
+
3
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
e15a9f4b
Use pandas to read header
· e15a9f4b
jvfpw18
authored
5 years ago
database/actions.py
+
3
−
2
Options
@@ -28,6 +28,7 @@ from database.database_table import gen_data_table, copy_tabbed_to_csv
import
database.groups
import
settings
from
database.groups
import
DATA_GROUP
,
DATABASE_TABLE_NAME
import
pandas
as
pd
ENGINE
=
create_engine
(
settings
.
DATABASE_URI
,
echo
=
settings
.
ECHO
)
META
=
MetaData
(
bind
=
ENGINE
)
@@ -44,8 +45,8 @@ sqlalchemy_logger.setLevel(settings.LOGGING_LEVEL)
def
temporary_data
(
connection
,
file_name
,
table
,
year
,
offset
=
2
,
delimiters
=
[
'
;
'
,
'
\\
n
'
,
'"'
],
null
=
''
):
header
=
open
(
file_name
,
encoding
=
"
ISO-8859-9
"
).
readline
().
strip
(
)
header
=
header
.
split
(
delimiters
[
0
])
header
=
pd
.
read_csv
(
file_name
,
encoding
=
"
ISO-8859-9
"
,
sep
=
delimiters
[
0
]
)
header
=
[
h
.
strip
()
for
h
in
header
.
columns
.
values
]
ttable
=
table
.
get_temporary
(
header
,
year
)
ttable
.
create
(
bind
=
connection
)
Loading