Тёмный

Pandas 2.0 : Everything You Need to Know 

Rob Mulla
Подписаться 169 тыс.
Просмотров 120 тыс.
50% 1

In this video I give an overview of pandas 2.0 and the main changes related to the apache arrow backend.
Marc Garcia's Article: datapythonista.me/blog/pandas...
Timeline:
00:00 Intro
01:04 Legacy Numpy
02:49 Arrow Backend
03:44 Missing Values
04:33 Speed
05:47 Interoperability
07:42 Arrow Data Types
Check out my other videos:
Data Pipelines: Polars vs PySpark vs Pandas: • The BEST library for b...
Polars for Data Science: • Polars: The Next Big P...
Speed up Pandas Dataframes: • This INCREDIBLE trick ...
Avoid These Pandas Mistakes: • 25 Nooby Pandas Coding...
Links to my stuff:
* RU-vid: youtube.com/@robmulla?sub_con...
* Discord: / discord
* Twitch: / medallionstallion_
* Twitter: / rob_mulla
* Kaggle: www.kaggle.com/robikscube
::::::::::::::::::::
Music: Head Candy - William Rosati
Support by RFM - NCM: bit.ly/3jpOhJn
::::::::::::::::::::

Развлечения

Опубликовано:

 

5 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 125   
@BabakFiFoo
@BabakFiFoo Год назад
Rob, you are making the best videos. I am always watching them and learn new stuff. I learned python and pandas myself, and your videos helped me improve them several times fold. thank you!
@irfanshaikh262
@irfanshaikh262 Год назад
I'm not sure what'd i'd be without you and this YT channel Rob. Thanks for being and amazing teacher to a rookie like myself lots of respect and love
@robmulla
@robmulla Год назад
Thanks for the feedback!
@JohnnyBoun
@JohnnyBoun Год назад
Yeah. Except I'm no 'rookie' I'm a seasoned veteran of what was called back in the day, a "database programmer.' We carved our code into stone with flint arrowheads. Now, things are very different. No more stone carving. We've got "Full stacks" now. So it took me about oh... couple of weeks to get any data on my console. Still can't get the "Full Monty", maybe because 3.8 GHz Pentium and 8 Gb isn't enough desktop power? Hard to believe, but hey, it's 2023. Time to face Big Data. By the way, I studied computational biology recently and the amount of DNA sequences is known as "totally insane." Back to thanking Mr. Mulla. Can't thank you enough for getting the important imports imported in the correct order not to confuse the wonderful "Full Stack" too much!
@TheMacister
@TheMacister Год назад
Thanks Rob! Couple months seeing your videos and your content is on the spot ! 🎉
@robmulla
@robmulla Год назад
Hey! I apprecaite the feedback Marcos. I'll try to keep it up.
@igordeoliveirabarrosfaluhe6350
Thank you Rob! Your videos are always useful with a such nice flow!
@mrdbourke
@mrdbourke Год назад
Epic video Rob! I use pandas everyday and glad to hear it’s getting faster!
@chintansawla
@chintansawla Год назад
Thanks for sharing the update! Very well articulated
@robmulla
@robmulla Год назад
Appreciate the feedback!
@edwardCYHsu
@edwardCYHsu Год назад
I am working exactly on my programming assignment of the date manipulation and it is very confusing. With the PyArrow datatype support, it is a lot easier from now. Thank you for highlighting the significance to us. You are a saint.
@gustavojuantorena
@gustavojuantorena Год назад
Great video Rob! I think Pandas will continue to be very useful in the data science community.
@robmulla
@robmulla Год назад
Glad you liked the video. I agree, I don't think it's going anywhere anytime soon and 2.0 is a good move for them to adapt to newer backends.
@baldpolnareff7224
@baldpolnareff7224 Год назад
I agree, they used the right approach. Don't break legacy code, while allowing people to refactor it easily when necessary
@Alexr26
@Alexr26 Год назад
Your channel is pure gold.
@robmulla
@robmulla Год назад
Thanks. I appreciate that!
@puzobaklan
@puzobaklan Год назад
Thank you Rob! Great explained!
@robmulla
@robmulla Год назад
Thanks for watching. 🙏
@Chuukwudi
@Chuukwudi Год назад
Awesome! Thanks for the update.
@robmulla
@robmulla Год назад
Anytime Chuck.
@farazahmed1668
@farazahmed1668 Год назад
thank you so much for such a kind information.
@robmulla
@robmulla Год назад
Glad you found it helpful!
@rayankhan12
@rayankhan12 Год назад
I particularly liked the conversion between the Pandas with Arrow backend and polars.. maybe you should make a separate video on it
@kevon217
@kevon217 Год назад
Thanks for this update!
@robmulla
@robmulla Год назад
Thanks for watching!
@michaelsoldmann7792
@michaelsoldmann7792 Год назад
Hi Rob, thank you for the content. I'd be interested in seeing a video on using the old np.where() and np.select() in the new pandas 2.0.
@AbrahamMendoza
@AbrahamMendoza Год назад
Thanks, Rob. Great video!
@robmulla
@robmulla Год назад
Thanks for the comment!
@LeveragedAlpha
@LeveragedAlpha Месяц назад
Dope video! Would be interesting to see how it compares to polars. Also, what software do you use to record your face in that circle?
@duypham6729
@duypham6729 Год назад
great video, tks Rob
@vincentverdugo
@vincentverdugo Год назад
Hey, your DS videos are awesome! I was using ChatGPT to learn more about Apache Arrow, Polars, etc from all your videos. Can you do a coding livestream or video about bioinformatics data like biological sequence data or drug development data? Thank you!
@AFlockOfToasters
@AFlockOfToasters Год назад
Good job pronouncing Interoperability!
@TheSoonAnn
@TheSoonAnn Год назад
very informative, thanks
@robmulla
@robmulla Год назад
Thanks for watching!
@incremental_failure
@incremental_failure Год назад
I was about to switch to Polars but now with Pandas Arrow dtypes, I need to do more research. Speed is one thing but lazy processing and memory usage are very important.
@x-axis97
@x-axis97 Год назад
Hey Rob! That text editor looks awesome. Which one is it?
@pietraderdetective8953
@pietraderdetective8953 Год назад
ah yess the much needed Pandas improvement! this is what I like in a competitive environment..it sharpens everyone involved. I agree with what has been said in the comment section: now we can use Pandas to handle large dataset properly. especially that 20x speed improvement when reading data using Pyarrow backend is so good!
@robmulla
@robmulla Год назад
I agree. I'm excited to see how it takes off once officially released. The only problem is people won't be able to ask chatGPT how to properly use pandas 2.0 since chatGPT only goes up to 2021 😆
@katrinabryce
@katrinabryce Год назад
In a few projects I’ve worked on recently, I found that switching from Pandas to pure Numpy speeded up execution time from about 30 minutes to less than a second on my hardware with about 50m rows of data.
@arjunekrishna7044
@arjunekrishna7044 Год назад
@@robmulla chatgpt 4 incoming
@nikjs
@nikjs Год назад
This int converting into float has been a long time PITA for me. This upgrade will be much welcome.
@RuslanKovtun
@RuslanKovtun Год назад
My very first thought was: yeah, with pyarrow as a backend, everything single software that relies on numpy has to be rewritten. But at the ends it doesn't looks like a big problem or a problem at all.
@saitaro
@saitaro Год назад
Yeah, cool thing indeed.
@Alexander-pk1tu
@Alexander-pk1tu Год назад
I would like to see more about aggregate performance. How it scales in CPU cores if it is still single-core.All for varying sizes of dfs
@robmulla
@robmulla Год назад
Thats a good idea. I'll try to think about how I could do that. There might be some settings for limiting the CPU use but also I know h2o does some benchmarks across different libraries.
@franky12
@franky12 Год назад
I would be interested to know how much time you lose when converting from pandas to polars and back to pandas?
@robmulla
@robmulla Год назад
That’s a good question that I should experiment with. The article says the only thing it actually needs to move is metadata, so I’m guessing it doesn’t take very long at all.
@omarei
@omarei Год назад
As a non coder I thought this was a joke
@dansplain2393
@dansplain2393 Год назад
Depends on the temperature
@dev_time
@dev_time Год назад
@@dansplain2393 lmao
@EricLebigot
@EricLebigot Год назад
Rob, do you have any limitations of Arrow to share? Until recently, for example, if I'm not mistaken, Arrow didn't seem to handle Pandas' multi indexes.
@robmulla
@robmulla Год назад
That’s a good question! I’m sure we will know a better answer once people start using it more. I forgot about the multindex limitation! I need to see how that works in pandas 2.0
@econhelp583
@econhelp583 Год назад
Thanks very much Rob! Your content is off the charts good, a true outlier, and a great outlier! To get my grad degree in stats, I had to take a PhD-level course in statistical consulting. The prof for that course actually wrote a whole book solely on the topic of outliers, outliers can be extremely important. To me, data science is a subject of stats, similar to the way experimental design or survey sampling are subjects of statistics. I think it is unfortunate that data science is not widely seen as belonging to “statistics” since it makes it harder (at least for me) to use data science tools when teaching stats, as the expectation is to use an old school approach to descriptive and inferential statistics in the classroom. I think your content has the clarity and insight to convince teachers that data science methods MUST be brought into the standard curriculum, e.g. courses like Introductory Business Statistics. Thanks again for posting truly remarkable content!
@victord8866
@victord8866 Год назад
When you imported Polars, I thought you were going to do a versus on speed between Polars and Pandas with the new backend. But still very informative video, thanks so much!
@robmulla
@robmulla Год назад
Maybe I can do that in the next video. I did test it out in my live stream video from yesterday. For speed generally: Polars > Pandas 2.0 > Pandas 1.5
@incremental_failure
@incremental_failure Год назад
@@robmulla Seeing the same here, Polars is still much faster than Pd 2.0.
@KenJee_ds
@KenJee_ds Год назад
Awesome! Are there any drawbacks to using the pyarrow backend?
@robmulla
@robmulla Год назад
Thanks Ken! Backwards compatibility and the fact that the integration is still very new and might be buggy are two that come to mind.
@murphygreen8484
@murphygreen8484 Год назад
Can you make a video giving techniques to update pandas (or polars) columns using vectoring instead of .apply() for more complicated custom function calls? eg. I want to take a str column, split it on a delimiter, do work on each section and then combine them back and return it as the new value for the same column
@robmulla
@robmulla Год назад
I actually have a short about this topic - using the str methods on string columns in pandas: ru-vid.com5eYTaYHzoEE
@incremental_failure
@incremental_failure Год назад
What's the issue, you just return the new value in the applied function. You will be needing to use python functions to split and join though.
@sitrakaforler8696
@sitrakaforler8696 Год назад
Pandas is life. Even if Polars is cool.
@robmulla
@robmulla Год назад
Yes it is! 😆
@Erosis
@Erosis Год назад
When you swap between pandas and polars, is python creating a copy of the dataframe into memory or is it just referencing the already allocated block of memory with the pyarrow backend?
@robmulla
@robmulla Год назад
Great question. It's a little complicated and for things like metadata there is a copy made, but my understanding is that the underlying data is not copied. The article I've linked in the description goes into a lot more detail about it and I'd suggest checking that out.
@Erosis
@Erosis Год назад
@@robmulla Awesome! Thank you so much! I've been avoiding pandas for large datasets, but this looks like it will make me a more dedicated user!
@robmulla
@robmulla Год назад
@@Erosis Exactly! I think that's the idea.
@Micro-bit
@Micro-bit Год назад
Hey Rob, Great stuff! .. I moved my data transformation app to PD2.0 and I have a problem with data conversion. When Im converting data from int[pyarrow] to string using astype(str) im loosing pyarrow and pandas convert it to object :/. I cant find the tool to do it properly. All best!
@berdeter
@berdeter Год назад
Just one thing I don't understand. If boolaens are stored on single bits (really a great idea), how comes they can have 3 states (True, False, None). Wouldn't that require 2 bits ?
@wolfeygamedev1688
@wolfeygamedev1688 7 месяцев назад
Aint nothing stored as one bit in python
@haierpad5669
@haierpad5669 Год назад
do you think this can have any "consequences" to the develop of numpy? I use pandas for data management but also use numpy and scipy and is very handy the way you can work with all of them till now. don't know if arrow can make the job so easy. also, can this make things more difficult for plotting stuff with matplotlib and seaborn, i.e.? p.d. thanks for the video and also for the previous 1h live stream in-ter-oper-a-bi-li-ty :D
@robmulla
@robmulla Год назад
Haha. I pronounced interoperability in this video 😂. I don’t think numpy is going anywhere. When working with non-tabular types of data numpy is strong. Also libraries like PyTorch and Tensorflow allow you to convert between tensors and numpy and those are very popular.
@dmail44
@dmail44 Год назад
There is an Int64 (capital i) which stores int with nulls
@random-drops
@random-drops Год назад
Wow! I'm still struggling in pronouncing "Interoperability" and it came out so fluid out of your mouth. Bet you are to release a video comparing pandas 2.0 vs Polars. Is Numpy still in pandas 2.0 due to backward compatibility?
@robmulla
@robmulla Год назад
Wait... did I actually say "Interoperability" correctly? I filmed myself saying it a bunch of times and just keep the one that sounds the best :D To answer your question yes, pandas has backwards compatability, as I show in the video by default it still uses the numpy backend.
@MrOnePieceRuffy
@MrOnePieceRuffy Год назад
It's a very good Video and this Library a good improvement, however ^^ nobody stops you from using a single int and store 32 different boolean states into it with bit shifting operations, but using a Interpreted Script Language means from the beginning "I trade resources for convenience". The underlaying Engine of Python is C and in C there is no actual boolean datatype, the smallest unit is the exact smallest unit the Operating System can provide which are 1 byte / 8 bits which the Operating itself only can provide to you if it reserves a whole virtual memory page for you. I just think, to nitpick about 7 wasted bits as a Python Programmer is a little bit awkward. The rest was great, thanks for the Video
@tahaknk1485
@tahaknk1485 Год назад
Now that the beta is out is there any estimation about release ? Btw thx for the video !
@robmulla
@robmulla Год назад
I only know what has been publicly said by the core dev team. Hope to know soon
@AxDhan
@AxDhan Год назад
and what about loading big dataframes? it will improve?
@LeoAr37
@LeoAr37 Год назад
Is the PyArrow backend not gonna be the default? it would be annoying to have to specify the dtype for every table I have
@robmulla
@robmulla Год назад
With a library as established as pandas, I don’t think they want to implement breaking changes, so having it as an option, at least in early releases I think is the right choice.
@yveslaporte5808
@yveslaporte5808 Год назад
One day, I learned that Python was slow for large data, so I started to study Julia who's reputation is "the fastest". One programmer I talked with said to me "No Python is fast!" And maybe new Pandas helps for speed matter. How should I take it from your point of view?
@robmulla
@robmulla Год назад
I think it’s mostly about choosing the correct tool for the job. But this in general is moving pandas towards being a faster library.
@kerimsever6674
@kerimsever6674 Год назад
I get unknown engine: pyarrow but I have pandas 2.0 and Pyarrow 10.0.1. Am I missing something ?
@kliti09
@kliti09 9 месяцев назад
pandas 2.0 with pyarrow backend VS pyspark dataframes?
@ys98110
@ys98110 Год назад
Wow. First time seeing these data types. When would you not use pyarrow and just use default python or something else?
@robmulla
@robmulla Год назад
I think eventually it will become adopted by most users, but pandas doesn’t want to make major changes. It also might be some time before it’s stable enough to trust in production code.
@bagavathirajanramaraj7390
@bagavathirajanramaraj7390 Год назад
When should I be using pandas 2.0 vs Polars?
@robmulla
@robmulla Год назад
Check out my video on data pipelines comparing them and pyspark!
@onedori1
@onedori1 Год назад
Can you make a tutorial on how to use the new upgraded MediaPipe object detection in python with live stream footage?
@robmulla
@robmulla Год назад
Great idea. I can try! Too many good ideas and not enough time.
@onedori1
@onedori1 Год назад
@@robmulla Nice to hear! If you make this work, you'll make my whole month. I've been struggling with this one since the upgrade came out..
@rito_ghosh
@rito_ghosh Год назад
Do you have any affiliations to Polars?
@robmulla
@robmulla Год назад
Nope. I’m just me.
@smellypunks
@smellypunks Год назад
This sorts two big issues, non-nullable ints, and the object dtype both can be frustrating.
@MattRose30000
@MattRose30000 Год назад
Wait, how can Arrow store booleans as one bit each AND allow None values?
@robmulla
@robmulla Год назад
Good catch! I think the bool values use a single bit but every column has a null array associated with it. But I also don’t know that for sure. But that would mean that a nullable bool would me more than one bit.
@googleyoutubechannel8554
@googleyoutubechannel8554 6 месяцев назад
Hmm, Arrows seems great, but I had no idea something as fundamental as Pandas and NumPy was so janky, with really really sketchy quirks. Now I'm wondering what the speedup would be if you tried these operations with a system that wasn't using at least some scripting language interpreter calls for raw data shuffling? Like just a normal struct.
@sujeetomar5843
@sujeetomar5843 Год назад
what is purpose of use_nullable_dtype=True
@Kaassap
@Kaassap Год назад
Id be living in the dark if it wasnt for this video 🤣
@joelluth6384
@joelluth6384 Год назад
I wonder how much of my code this will break. Upgrading sqlalchemy to v2 was like sticking a grenade in my computer.
@robmulla
@robmulla Год назад
Its supposed to be backwards compatible. You won't know for sure until you try.
@prashlovessamosa
@prashlovessamosa Год назад
Hey rob this video is not showing not even got a notification re-upload it, only way I got access to this video by going to your playlist.
@robmulla
@robmulla Год назад
Hey! You aren't supposed to see this yet :D - I have it as unlisted and am suprised you could even find it!
@prashlovessamosa
@prashlovessamosa Год назад
@@robmullahey Rob actually haven't updated my yt using one year older version of RU-vid I always get 5 sec ads and i can also download videos in 1080p idk how that's possible but working for me even sometime i am able to see private videos those youtubers also always asked me how i am able to play their private videos. Conclusion:- Google is stupid
@arturjaroszewicz8424
@arturjaroszewicz8424 Год назад
First time watcher feedback: Great video! Clickbait-y title, could at least have a more positive spin :)
@robmulla
@robmulla Год назад
Thanks for the feedback. Unfortunately the RU-vid algorithm favors videos with higher click through rates. I’m experimenting with more enticing titles although I agree with you I wish I didn’t have to.
@tigerbojiteol
@tigerbojiteol Год назад
in·tr·aa·puh·ruh·bi·luh·tee. Remember that Rob, 😉
@robmulla
@robmulla Год назад
Oh no. Did I say it wrong 😑
@tigerbojiteol
@tigerbojiteol Год назад
@@robmulla Not at all. You nailed it 👍
@mlengineer8564
@mlengineer8564 8 месяцев назад
pd.options.mode.dtype_backend = 'pyarrow' This option is dead now in pandas 2.0.3. It must have only been a part of the release candidate
@hannessteffenhagen61
@hannessteffenhagen61 Год назад
I think with all this talk about pandas and polars people these days often neglect to even consider grizzlies.
@robmulla
@robmulla Год назад
I can't BARE it! 😄
@TylerMacClane
@TylerMacClane Год назад
Hi Rob my second comment I'm glad)
@robmulla
@robmulla Год назад
Nice! The first commenter was able to see it before I even made the video public :D so lets call it a tie.
@solomon5888
@solomon5888 Год назад
do you think 90% of data analyst will be eliminated due to GPT4.0 and further integration of machine learning in MS 365?
@robmulla
@robmulla Год назад
Absolutely not.
@zeus7914
@zeus7914 Год назад
lol. funny stuff.
@fahnub
@fahnub Год назад
Apache Arrow is so much better.
@robmulla
@robmulla Год назад
Oh yea? In what way? Do you mean how it’s integrated into pandas 2.0?
@fahnub
@fahnub Год назад
@@robmulla yessir 💯
@comment8767
@comment8767 Год назад
Background music is slightly annoying. Your normal voice is peasant, so no need to supplement it.
Далее
Unbelievable Face Swapping with 5 Lines Code
11:00
Просмотров 66 тыс.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Super gymnastics 😍🫣
00:15
Просмотров 5 млн
Жизнь
00:58
Просмотров 2,6 млн
The BEST library for building Data Pipelines...
11:32
25 nooby Python habits you need to ditch
9:12
Просмотров 1,7 млн
What is Polars?
1:32
Просмотров 11 тыс.
How To Use Pandas In Python
6:45
Просмотров 456
SQL Databases with Pandas and Python - A Complete Guide
16:59
Make Your Pandas Code Lightning Fast
10:38
Просмотров 176 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1 млн
Страшный сон перекупщика
1:00
Просмотров 2,7 млн