Fork me on GitHub
#off-topic
<
2019-01-17
>
agigao11:01:24

Oh god, help me...

def get_data(category="App"):
    df = pd.read_csv('data/data.csv', parse_dates=['PERIOD'])
    df = df[df['MODEL_TYPE'] == "App"]
    df = df.set_index(['MODEL_NAME'])
    df = df.sort_values(by=['PERIOD'])
    return df

🙏 5
chrisulloa16:01:27

why don’t you use a thread macro instead?

souenzzo17:01:51

there is a unit test showing what it do, right?

agigao17:01:36

@U2J4FRT2T actually good explanation is provided in a book by the author of Pandas. Nonetheless, I wrote better code than 2 ways provided in the book: Python for Data Analysis.

souenzzo18:01:16

df = df[df['MODEL_TYPE'] == "App"] should be df = df[df['MODEL_TYPE'] == "App" ? 1 : 0] My eyes are burning

vemv16:01:32

shouldn't it be using 600% cpu? macos, 6 cores. ag == the_silver_searcher it surprises me given the 8 threads are there

schmee16:01:57

I used to use ag but ripgrep beats it in pretty much every aspect, especially speed

vemv16:01:22

working very nicely, thanks! it gives me instant results on a 25GB corpus of pwned_passwords. ag nothing, it just seems to hang (probably it chokes on it given the corpus size)

ordnungswidrig15:01:08

What’s the rg equivalent of ag’s --file-search-regex?

ordnungswidrig15:01:32

I like doing ag --file-search-regex project\\.clj -L "main" e.g.