import pandas as pd
import numpy as np
import janitor
import pandas as pd
df = pd.DataFrame({'x': [1, 1, 1, 2, 2, 3],
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datatable import dt, f | |
from typing import Pattern, NamedTuple, Union | |
from collections import Counter, defaultdict | |
from itertools import compress, chain | |
import re | |
import numpy as np | |
class measure(NamedTuple): | |
"""reshape either with a separator or a regular expression.""" | |
column_names:Union[str, list] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data is from DuckDB's github repo | |
# https://github.com/duckdb/duckdb/tree/master/benchmark/micro/join | |
import pandas as pd; import numpy as np; import janitor as jn; import duckdb | |
query = """SELECT SETSEED(0.8675309); | |
CREATE TABLE events AS ( | |
SELECT *, | |
"start" + INTERVAL (CASE WHEN random() < 0.1 THEN 120 ELSE (5 + round(random() * 50, 0)::BIGINT) END) MINUTE | |
AS "end" | |
FROM ( |