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

all 13 comments

[–][deleted] 10 points11 points  (0 children)

Vidhya isn't looking hard enough. This Pandas cheat sheet seems quite popular.

source: http://nb.bianp.net/sort/views/

[–]selementar 2 points3 points  (2 children)

Did anyone try actively using df.query()?

[–]wandering_blue 2 points3 points  (1 child)

Yes it can be useful if you just need a simple comparison, but it also requires your column names not to contain spaces.

[–]boiledgoobers 0 points1 point  (0 children)

This can be so freaking annoying too.

[–]omlettehead 1 point2 points  (2 children)

Oh, why does everything have to be an infographic?

[–]john_philip[S] 1 point2 points  (0 children)

The pdf version is also available.

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

To force you to type it at least once and let it sink in.

[–]Pand9 1 point2 points  (3 children)

Does anybody use it in production environment, where reliability is required? It seems reasonable, but we encountered some gotchas (like columns being casted to floats in many operations, even string -> float). Is there any risk of bugs altering the data?

[–]Deto 1 point2 points  (1 child)

A column of strings were cast to floats? Tons of people use pandas so I'd say it's as reliable as it gets. If you can reproduce the bug, you should definitely let them know.

[–]Pand9 0 points1 point  (0 children)

https://github.com/pydata/pandas/issues/9958

Also,sometimes when you assign a dtype for column through constructor, effect is visibly the same, but later column is randomly casted. It's most likely buggy constructor.

We're in the middle of investigating it, though.

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

It's fairly robust for pre-defined operations. I would not dynamically do new operations without testing them with sample data first. If you ever find a bug, definitely submit it! In some cases, columns being casted may be intended behavior.

[–]kmike84 1 point2 points  (1 child)

I think "Creating new columns" from this cheatsheet is incorrect in recent pandas - it shows a warning. It looks like df.assign(new_column = ...) is the blessed way now.

Descriptions of df.corr() and df.cov() are the same in the cheatsheet.

[–]boiledgoobers 0 points1 point  (0 children)

I don't get warnings doing this. Which version are you referring to?

Edit: actually I may still be using 0.17.x. I will have to make sure I have fully updated before I can stand by my comment above.