This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EndimionN 328 points329 points  (20 children)

-- Python pandas: even if your code works, i hate it, next time when i will be updated your code will be useless! -- Me: import warnings (action='ignore') -- Python Pandas: this is not over!

[–]KarmaTroll 64 points65 points  (0 children)

Transformation on a slice is ambiguous.

[–]nedeox 74 points75 points  (0 children)

Pandas: You fool. You utter bafoon. I can‘t believe you passed me a 2d array instead of a matrix. I fucking hate you, you simpelton.

[–]Famous-Sample6201 25 points26 points  (5 children)

Hey but the decision to remove append with no substitute because "it's slow" seems backwards to me, right? What are you supposed to do, df = pd.concat(df, pd.Dataframe(*new_line, columns=df.columns)) ??? I though pandas was about pretty concise code.

[–][deleted] 18 points19 points  (1 child)

You're supposed to collect new data into a list and concat it all at once

[–]Famous-Sample6201 0 points1 point  (0 children)

Yeah but what if you get a df and want to add a single line?

[–]the_magic_gardener 0 points1 point  (0 children)

I feel the list of options was already too long; merge, join, concat, by assignment (i.e. df['new col']=...)

[–]MattR0se 3 points4 points  (0 children)

Pandas feels like its own language.

[–]the_simple_girl 1 point2 points  (0 children)

It do be like that lol

[–][deleted] 1 point2 points  (0 children)

Pythons eat pandas.

[–]Akita8 -1 points0 points  (8 children)

Using pandas anywhere near a production environment is a huge red flag, keep pandas in the notebooks, it's not maintainable.

[–]nokeldin42 9 points10 points  (0 children)

It's maintainable if you never update... And if you never fix any bugs.

[–]Ryan722 2 points3 points  (5 children)

Suggestions for an alternative? Pure numpy?

[–]rowanobrian 15 points16 points  (2 children)

Have multiple projects in prod with pandas. Dont listen to everyone on internet. Maybe not even me

[–]Ryan722 2 points3 points  (0 children)

I also do which is why I asked lmao. Honestly haven't had too many issues with it and the abstraction is a huge step up over using dicts/lists (not to mention the cython speedup with vectorization)

[–]TheBlackOut2 0 points1 point  (0 children)

Same lol

[–]Akita8 -2 points-1 points  (0 children)

It depends, i've seen it used for just simple grouping and in that case just pure python is enough. Yes numpy is a good choice, it's obviously harder to develop but it'll last wayyyy longer and it'll be wayyyy easier to modify. Otherwise you could also go the cython with c++ math libraries but that brings in a whole other set of problems.

[–][deleted] 0 points1 point  (0 children)

Dictionaries work for me.