|
58 | 58 |
|
59 | 59 | 00:02:25 me on the socials and I'm happy to talk about it. Hope to see you there.
|
60 | 60 |
|
61 |
| -00:02:27 Ruven, welcome back to Talk Python To Me. How are you doing? |
| 61 | +00:02:27 Reuven, welcome back to Talk Python To Me. How are you doing? |
62 | 62 |
|
63 | 63 | 00:02:32 I'm doing great. Great to be back here. Nice to see you.
|
64 | 64 |
|
|
112 | 112 |
|
113 | 113 | 00:04:28 waited a while, cause it'd been like a year between the ban and me noticing. So they couldn't
|
114 | 114 |
|
115 |
| -00:04:33 do anything about it. So I was like half laughing and half like, you gotta be kidding me about this. |
| 115 | +00:04:33 do anything about it. So I was like half laughing and half like, you got to be kidding me about this. |
116 | 116 |
|
117 | 117 | 00:04:39 and I posted on my blog about this and you guys picked it up. on Python bites,
|
118 | 118 |
|
|
192 | 192 |
|
193 | 193 | 00:07:48 I'm going to bleep that part. Every time the word pandas is said, we're bleeping it out on
|
194 | 194 |
|
195 |
| -00:07:51 the YouTube version. Well, this could be entertaining then. Wow. Reuben was really |
| 195 | +00:07:51 the YouTube version. Well, this could be entertaining then. Wow. Reuven was really |
196 | 196 |
|
197 | 197 | 00:07:57 testy. Like all those bleeps. No, seriously though. You know, let's, let's catch up. We'll
|
198 | 198 |
|
|
228 | 228 |
|
229 | 229 | 00:09:11 for example, and they had this short, cute article about the number of animals that go
|
230 | 230 |
|
231 |
| -00:09:16 through Heathrow airport every year. I was like, wait, there's gotta be a dataset for that. And |
| 231 | +00:09:16 through Heathrow airport every year. I was like, wait, there's got to be a dataset for that. And |
232 | 232 |
|
233 | 233 | 00:09:21 sure enough, the Heathrow airport authority publishes a dataset in CSV of how many animals
|
234 | 234 |
|
|
350 | 350 |
|
351 | 351 | 00:13:34 learned, like some of the idioms from Python are not appropriate. So I was giving a class in like
|
352 | 352 |
|
353 |
| -00:13:39 optimizing pandas, like a short class, we'll call it microclass, like 90 minutes long, |
| 353 | +00:13:39 optimizing pandas, like a short class, we'll call it micro class, like 90 minutes long, |
354 | 354 |
|
355 | 355 | 00:13:43 about a year or so ago. And at the end, I was like, oh, and by the way, obviously just never do for loops. And everyone's like, wait, wait, wait, what?
|
356 | 356 |
|
|
396 | 396 |
|
397 | 397 | 00:15:28 has its own idiomatic style that is different than what you would call Pythonic, right? Like
|
398 | 398 |
|
399 |
| -00:15:34 it's Pandonic. I don't know what the name is, but idiomatic pandas, right? Where there's things that |
| 399 | +00:15:34 it's Pydantic. I don't know what the name is, but idiomatic pandas, right? Where there's things that |
400 | 400 |
|
401 | 401 | 00:15:40 are specific to pandas, like this vectorization stuff, right? Instead of looping over, right?
|
402 | 402 |
|
|
450 | 450 |
|
451 | 451 | 00:17:51 I initialized the logger with the string info for the level rather than the enumeration dot info,
|
452 | 452 |
|
453 |
| -00:17:58 which was an integer-based enum. So the logging statement would crash, saying that I could not |
| 453 | +00:17:58 which was an integer-based Enum. So the logging statement would crash, saying that I could not |
454 | 454 |
|
455 | 455 | 00:18:04 use less than or equal to between strings and ints. Crazy town. But with Sentry, I captured it,
|
456 | 456 |
|
|
522 | 522 |
|
523 | 523 | 00:20:52 vast. Yeah. Or pandas too comes out or something like that. Yes. Yes, indeed. I mean, I've been
|
524 | 524 |
|
525 |
| -00:20:57 exploring, I mean tomorrow, tomorrow I head off to Prague for EuroPython, where I'm giving a talk |
| 525 | +00:20:57 exploring, I mean tomorrow, tomorrow I head off to Prague for Euro Python, where I'm giving a talk |
526 | 526 |
|
527 |
| -00:21:02 on a pyarrow in pandas. And so I've been looking into that a lot and oh boy, right. I mean, I've |
| 527 | +00:21:02 on a Pyarrow in pandas. And so I've been looking into that a lot and oh boy, right. I mean, I've |
528 | 528 |
|
529 | 529 | 00:21:08 been using it for say a year or so, but it's amazing. And yet there are all these subtle
|
530 | 530 |
|
|
690 | 690 |
|
691 | 691 | 00:27:48 to like multi-step it. And I would just love to see more of it, but let's talk.
|
692 | 692 |
|
693 |
| -00:27:51 Well, I'll just, I'll just say there on that front. So CanDoes like does have the option to |
| 693 | +00:27:51 Well, I'll just, I'll just say there on that front. So Condos like does have the option to |
694 | 694 |
|
695 | 695 | 00:27:58 either get back a new data frame or to say in place equals true. And then it does it locally,
|
696 | 696 |
|
|
930 | 930 |
|
931 | 931 | 00:37:37 you know, send taxis at different places. - Sure, have a special program for long distance
|
932 | 932 |
|
933 |
| -00:37:41 stuff or whatever. Yeah. - Right. Right. Or if you're Uber, you know where to place, they actually used to have the geog, the longitude and latitude of where |
| 933 | +00:37:41 stuff or whatever. Yeah. - Right. Right. Or if you're Uber, you know where to place, they actually used to have the geography, the longitude and latitude of where |
934 | 934 |
|
935 | 935 | 00:37:48 people were picked up and dropped off and they got rid of that. And I'm sure both for privacy
|
936 | 936 |
|
|
1054 | 1054 |
|
1055 | 1055 | 00:42:52 Precisely. Precisely. And so another nice way to do this also is not just read this one and read
|
1056 | 1056 |
|
1057 |
| -00:43:00 that one, but you can use a list comprehension with something like glob. So glob.glob on star.csv, |
| 1057 | +00:43:00 that one, but you can use a list comprehension with something like glob. So glob. Glob on star.csv, |
1058 | 1058 |
|
1059 | 1059 | 00:43:06 get back a list of data frames and then just hand that to pd.concat. And so that's where
|
1060 | 1060 |
|
|
1090 | 1090 |
|
1091 | 1091 | 00:44:27 I don't think that like they need to learn that. So and like a lot of the standard library there,
|
1092 | 1092 |
|
1093 |
| -00:44:31 it's hard to say. Right. So as I said, I love glob, right? Globbing is fantastic. |
| 1093 | +00:44:31 it's hard to say. Right. So as I said, I love glob, right? Globing is fantastic. |
1094 | 1094 |
|
1095 | 1095 | 00:44:36 But that's definitely not in like my intro class. I would say, oh, by the way. Yeah. I would bet
|
1096 | 1096 |
|
|
1198 | 1198 |
|
1199 | 1199 | 00:48:51 I read this fantastic book a few years ago called Cork Dork by this journalist who decided to become
|
1200 | 1200 |
|
1201 |
| -00:48:57 a Somalier and she took the exam and her journey toward there, she convinced me these words actually |
| 1201 | +00:48:57 a Sommelier and she took the exam and her journey toward there, she convinced me these words actually |
1202 | 1202 |
|
1203 | 1203 | 00:49:03 have real meaning and people are very serious about it. So I will not roll my eyes quite as
|
1204 | 1204 |
|
|
1228 | 1228 |
|
1229 | 1229 | 00:49:55 break that into a list. But now what? Now I have a series of lists. Now what do I do?
|
1230 | 1230 |
|
1231 |
| -00:49:59 And so one of the key methods to know here is something called explode. And explode is |
| 1231 | +00:49:59 And so one of the key methods to know here is something called Explode. And Explode is |
1232 | 1232 |
|
1233 | 1233 | 00:50:05 let's take a series of lists and turn that into a very, very, very long series. And so basically
|
1234 | 1234 |
|
|
1422 | 1422 |
|
1423 | 1423 | 00:57:55 have more big cities than I realized? And you know, where's New York and New Jersey? Like it's
|
1424 | 1424 |
|
1425 |
| -00:58:00 way down the line. You think of those as having like pretty megatropolis type places. Massachusetts. |
| 1425 | +00:58:00 way down the line. You think of those as having like pretty metropolis type places. Massachusetts. |
1426 | 1426 |
|
1427 | 1427 | 00:58:06 That's right. That's right. But it's how many cities, right? So, right, right, right. That's
|
1428 | 1428 |
|
|
1573 | 1573 | 01:03:47 host, Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and
|
1574 | 1574 |
|
1575 | 1575 | 01:03:51 write some Python code.
|
1576 |
| - |
0 commit comments