Pandas with Python 2.7 Part 10 - Function Mapping

preview_player
Показать описание
In this video we cover the notion of Function Mapping. Function mapping is not restricted to Pandas only. It is actually something that you can use in many cases. Function mapping, however, in the case of Pandas, will allow us to create our very own functions and pass them through Pandas as if it was a Part of Pandas. The downside here is that your efficiency in processing will be limited to how efficient you have written your code. If there is a way to do it in Pandas, you should try to do it with a tool they have provided to maintain speed, but, you can always use this method as a last resort to do exactly what you need.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

Thanks Sentdex from New Zealand. Have watched many of your vids and never disappoint. The last two years I have made huge strides with python in my spare time and just now saved our team of 8 people a huge amount of time on our public health project using pandas - (cleaned up a 11000 row 100 column excel spreadsheet with missing data and made a new useful column of "time since initiation with the service". This last part was very complex but only took 5-6 hours when it could have taken a week or been totally unachievable (we are all just medical students so in general have minimal data munging skills). Had fun doing it too!

All thanks to people like you in the python community.

donha
Автор

Great tutorial. Keep doing in what you do. You're helping many people around. Thanks from Slovakia

markovisnovsky
Автор

Excellent series. Enjoy your teaching style.

wwritz
Автор

F.Y.I. You can also use Lambda alike functions. e.g.   df['new'] = map(lambda x: x + 1, df['Close'])   This is very convenient.

dayworkhard
Автор

Yet again, you totally nailed it.

I'm floored by your ability to identify headache points - I really should just watch all your videos before I continue coding. But I won't, because I'm a glutton for punishment or something.

Well done.

I still don't have a paypal account :P

Achooification
Автор

Thanks for the reply. Three days are enough to let people see how effort I have spent. Bear in your mind that when I receive any question, I unswer directly without any kind of prediction. It is good to help without judjment. Thanks

samirsarsamss
Автор

In Python3 you don't even need to use map(). Just do:

df['Column 1 + 2'] = df['Column 1'] + df['Column 2']

for a simple calculation

arturmuellerromanov
Автор

did you make Part 11 of this video series.
if yes than can you please provide me a link for it.
please do mention "NO" if you had not made the next part.

sachi
Автор

I like you. Your tutorials saved a lot of my time from heavy googling for each and everything I need.
But it'd be even more wonderful if you could solve one mystery on python's help file :) Or, have you made a separate series about 'lambda'?


What is this expression saying (especially the string part - why is a math-like expression that can be operated upon written in a string)?
df = df.applymap(lambda x: '%.2f' % x)

PS: If you don't have 'lambda' series, it's cool to make one, since I don't think I'll ever find this answer, and you'll be the only guy who provides it :)

oliverli
Автор

It is very initial topic should be considered and introduced simply without any highlighting form me or from others. Really we should suffer the pain because of We are customers "do you know that?" Who said that "most people only help if you show that you've made honest attempts at first solving your problem yourself". Your talk means that cars' companies supposes keep waiting untill the customers suffering pain to provide a good service for them. Keep in your mind that time is money and if customers do not like your software, they will not waste their time and wait until you will observed how much pain he/ she suffered. Customer will directly search other software.

martinl
Автор

You're mad because you said something not logic like your sentence"most people only help if you show that you've made honest attempts at first solving your problem yourself" which does not make sense at all. By the way I've contacting them since 2 days but they do not pay any attention. Next time do not defend people you do not know well. Cheers

martinl