8000 updated readme · dhimu/python_reference@45c931b · GitHub
[go: up one dir, main page]

Skip to content

Commit 45c931b

Browse files
committed
updated readme
1 parent edc17e2 commit 45c931b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

useful_scripts/large_csv_to_sqlite.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
table_name = 'my_table' # name for the SQLite database table
1818
chunksize = 100000 # number of lines to process at each iteration
1919

20+
# columns that should be read from the CSV file
21+
columns = ['molecule_id','charge','db','drugsnow','hba','hbd','loc','nrb','smiles']
22+
2023
# Get number of lines in the CSV file
2124
nlines = subprocess.check_output('wc -l %s' % in_csv, shell=True)
2225
nlines = int(nlines.split()[0])
@@ -33,7 +36,7 @@
3336
skiprows=i) # skip rows that were already read
3437

3538
# columns to read
36-
df.columns = ['molecule_id','charge','db','drugsnow','hba','hbd','loc','nrb','smiles']
39+
df.columns = columns
3740

3841
sql.to_sql(df,
3942
name=table_name,

0 commit comments

Comments
 (0)
0