Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
1a24af8e
Commit
1a24af8e
authored
Sep 29, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add df_to_tidb.py
parent
3203f457
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
df_to_tidb.py
eda/recommended_indexs/df_to_tidb.py
+30
-0
No files found.
eda/recommended_indexs/df_to_tidb.py
0 → 100644
View file @
1a24af8e
# -*- coding: UTF-8 -*-
#把文件写到线下测试tidb
import
pandas
as
pd
from
sqlalchemy
import
create_engine
df
=
pd
.
read_excel
(
"ios.xlsx"
)
engine
=
create_engine
(
"mysql+pymysql://{user}:@192.168.15.12:4000/{db}"
.
format
(
user
=
"root"
,
db
=
"jerry_test"
))
df
.
to_sql
(
con
=
engine
,
name
=
'ios_meitu'
,
if_exists
=
'replace'
)
#把文件写到线上正式tidb
import
pandas
as
pd
from
sqlalchemy
import
create_engine
df
=
pd
.
read_excel
(
"ios.xlsx"
)
engine
=
create_engine
(
"mysql+pymysql://{user}:{pw}@10.66.157.22:4000/{db}"
.
format
(
user
=
"root"
,
pw
=
"3SYz54LS9#^9sBvC"
,
db
=
"jerry_test"
))
df
.
to_sql
(
con
=
engine
,
name
=
'ios_meitu'
,
if_exists
=
'replace'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment