Skip to content
Snippets Groups Projects
Commit 59cc68f5 authored by John-Paul Robinson's avatar John-Paul Robinson
Browse files

Split db load and create cell to avoid forced recreates

parent d8cad0c7
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
import sqlite3 import sqlite3
import slurm2sql import slurm2sql
import pandas as pd import pandas as pd
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
db = sqlite3.connect('test.db') db = sqlite3.connect('test.db')
```
%% Cell type:code id: tags:
```
slurm2sql.slurm2sql(db, ['-S', '2020-03-18', '-a']) slurm2sql.slurm2sql(db, ['-S', '2020-03-18', '-a'])
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
# For example, you can then convert to a dataframe: # For example, you can then convert to a dataframe:
df1 = pd.read_sql('SELECT * FROM slurm', db) df1 = pd.read_sql('SELECT * FROM slurm', db)
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
df1.head(5) df1.head(5)
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
print("more plots to come") print("more plots to come")
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment