Comments

You must log in or register to comment.

GTKdope t1_itush41 wrote

tqdm

27

carlml t1_itvkhb6 wrote

Why this? I have always seen people praise tqdm a lot, but I don't understand why.

1

zmjjmz t1_itwokw0 wrote

It's nice to know how long something is going to take

3

bironsecret t1_itun9pe wrote

.shape

11

Baggins95 t1_itux5qd wrote

*reshape

3

bironsecret t1_itvcys6 wrote

you can't reshape without knowing the shape bro

5

Baggins95 t1_itvy1g6 wrote

In many interesting cases this is actually very possible, e.g. broadcasting x.reshape(1, -1) * y.reshape(-1, 1) Rarely do I need to query the shape explicitly. Mostly a squeeze/unsqueeze leads to the goal. And often one knows the structure of the data explicitly, e.g. the dimensionality of a Euclidean space. I don't want to deny the use case for .shape entirely, but I think often it can be avoided.

1

bironsecret t1_itw7v9y wrote

can't agree, for unknown shapes I use permute or x.reshape(x.shape/2, x.shape/2) etc

1

Reazony t1_ituzwh3 wrote

parallel_apply.

3

SAint7579 t1_itvint1 wrote

Pandas .apply() and .to_datetime(). Pandas as a whole is a work of art!

3

-xylon t1_itycq7h wrote

.pipe() is another game changer, along with .assign(). I recently discovered you can pass callables to almost ANYTHING in pandas. Things like df.assign(newcolumn= lambda df: ... or better yet df[lambda x:....] and df.loc[lambda x:].

2

RustBucket03 t1_itvqgii wrote

Not necessarily a function but the njit decorator from numba.

2

BrianP21 t1_itz5qcx wrote

Import pytorch_lightning as pl

1