| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,9 @@ | |||
| 17 | 17 | table_name = 'my_table' # name for the SQLite database table | |
| 18 | 18 | chunksize = 100000 # number of lines to process at each iteration | |
| 19 | 19 | ||
| 20 | + # columns that should be read from the CSV file | ||
| 21 | + columns = ['molecule_id','charge','db','drugsnow','hba','hbd','loc','nrb','smiles'] | ||
| 22 | + | ||
| 20 | 23 | # Get number of lines in the CSV file | |
| 21 | 24 | nlines = subprocess.check_output('wc -l %s' % in_csv, shell=True) | |
| 22 | 25 | nlines = int(nlines.split()[0]) | |
@@ -33,7 +36,7 @@ | |||
| 33 | 36 | skiprows=i) # skip rows that were already read | |
| 34 | 37 | ||
| 35 | 38 | # columns to read | |
| 36 | - df.columns = ['molecule_id','charge','db','drugsnow','hba','hbd','loc','nrb','smiles'] | ||
| 39 | + df.columns = columns | ||
| 37 | 40 | ||
| 38 | 41 | sql.to_sql(df, | |
| 39 | 42 | name=table_name, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments