How I Organize Data In Python with Dataclasses

  Рет қаралды 30,085

John Watson Rooney

John Watson Rooney

Күн бұрын

Пікірлер: 45
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
Grab IPRoyal Proxies and get 50% off with code JWR50 at iproyal.club/JWR50
@faisalburdi9414
@faisalburdi9414 2 жыл бұрын
Can you make a vid where we can see how can we use this service in any example. It would be better if you can show us, you getting blocked and then extracting all the data by using any poroxy service . As always exceptional way teaching loved it and learned new thing today .
@ferrandonea
@ferrandonea 2 жыл бұрын
excellent video as usual, probably you can expand in how to use dataclasses with databases, for example with sqlalchemy
@starchildluke
@starchildluke Жыл бұрын
I've struggled to get to grips with dataclasses and find use cases for them in my work but this really helped. Also really relaxing to watch and listen to this video haha
@JohnWatsonRooney
@JohnWatsonRooney Жыл бұрын
Glad it helped!
@coyoteden8111
@coyoteden8111 Жыл бұрын
Wooooah I've been looking for something like this. Normally I'd create a class from scratch to store attributes, retrievable in dot notation. This is next level simplicity
@siriushp0904
@siriushp0904 2 жыл бұрын
This in off topic question, but I love how straight forward your videos are. I was wondering if you could do a video on how you organize your workspaces, files, test projects, KZbin walkthrough’s etc? I’m having a hard time figuring out an efficient, useful, and understandable organization system that prevents unintended duplicates, etc. brand new in the coding world, so I apologize if this is an easy topic. I found very quickly that files intended for a project could get out of hand fast, then figuring out everything the middle including not having a whole folder of things like packages that just seemed to multiply like rabbits. Eventually I ran into a bug that I couldn’t tell if it was my fault, a bug in the package, or I moved/deleted something that shouldn’t have been, or downloaded an extra copy. I finally just had to scrap quite a bit. Not a huge deal right now, but I really want to figure out a good and efficient file storage for my regular files, coding files, test project files, actual projects files, package locations, and eventually creating scripts that get used often that I can reference. My problem right now is I’m not sure how to do some things so I find myself attempting a new method to test it out and it gets really messy, really fast. Thanks for the content! Love watching your videos.
@chriskeo392
@chriskeo392 Жыл бұрын
Can we harmoniously combine dataclasses and pydantic?
@emiliod90
@emiliod90 Жыл бұрын
Really good overview John thank you 🙏
@JohnWatsonRooney
@JohnWatsonRooney Жыл бұрын
Thanks very kind .
@edwardwong654
@edwardwong654 Жыл бұрын
Does anyone have that URL handy so that I can just copy and paste?
@kashifrana6798
@kashifrana6798 12 күн бұрын
Great content. Can you please make a video to convert function into class and when to do that? Thanks
@stewart5136
@stewart5136 2 жыл бұрын
Excellent. dataclass and asdict = very helpful. Thanks
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
Yeah it’s handy to have it all done for you rather than having to write your own class method!
@durgeshkhade2417
@durgeshkhade2417 2 жыл бұрын
Thanks for the great tutorial!! :D
@TomKnudsen
@TomKnudsen 2 жыл бұрын
Do you have a tutorial on how to get certain information out of an json or cvs file?
@Klausi-uq4xq
@Klausi-uq4xq 2 жыл бұрын
I deal every day with data classes when i develop apps with flutter. In private datascraping projects with python i use dataclasses too..
@pilgrim0606
@pilgrim0606 2 жыл бұрын
Great explanation with good example...again👏
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
Thanks!
@PavanVarma369
@PavanVarma369 Жыл бұрын
Hi i am a Data science student and wanted to learn Web Scrapping, so can you please suggest me which of your playlist should I start with. I am at bignier level in Python as well.
@jamieosh70
@jamieosh70 2 жыл бұрын
What about using @dataclass with Scrapy (and then returning as dict)?
@srikanthkoltur6911
@srikanthkoltur6911 2 жыл бұрын
Thanks for the video I have been using pydantic library for a while it's pretty cool but still we need usage of classes in python i think
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
Yeah Pydantic is pretty great!
@danlee1027
@danlee1027 2 жыл бұрын
@@JohnWatsonRooney maybe a dataclasses pro con and where appropriate video?
@iwilllearneverything
@iwilllearneverything 2 жыл бұрын
mate, can you tell me how long it takes to learn python + django from scratch for backend & website development? ( no data science , game dev or anything but website dev ) . i have understanding of html, css & basic JS .
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
hard to say but a good few months I'd have thought. There's a lot of new concepts to learn plus then learning the django way. Certainly possible though. If you already know some JS maybe Node would be a better path, I think there's more jobs for JS
@StraightCoding
@StraightCoding 2 жыл бұрын
Excellent video! I have two question, I think Optional is not compatible with dict type, what we can do in that case? another question: is the dataclass decorator compatible when is using inheritance ?
@san24dec
@san24dec 2 жыл бұрын
Can you please add a video on how to use dataclass with pandas
@bakasenpaidesu
@bakasenpaidesu 2 жыл бұрын
Ohayou gozaimasu!
@Ocelot911
@Ocelot911 9 ай бұрын
As a guitarist pretty cool
@bx_h23
@bx_h23 2 жыл бұрын
Dataclass or pydantic basemodel?
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
Pydantic does more but data classes are in core python so one less dependency
@gedtoon6451
@gedtoon6451 2 жыл бұрын
In the video you say "You can add type hints". This should have been "You must add type hints" as they are mandatory with dataclasses.
@enricoroselino7557
@enricoroselino7557 Жыл бұрын
really want to use dataclasses but my data have 78 columns, maybe next time
@JohnWatsonRooney
@JohnWatsonRooney Жыл бұрын
How do you handle it now?
@enricoroselino7557
@enricoroselino7557 Жыл бұрын
i found a package named Box, its convert dicts into a "data class" like, it has the dot notation too very neat like you shown on dataclass but only downside its not popping up on autocomplete box, but its there. the types is still messed up so i use pandas dataframe anyway. luckily i have the table up in mssql so i reflect the column types and map it, not neat but my boss doesnt complain 😂 big thanks for dataclass explanation
@peeeeed52
@peeeeed52 2 жыл бұрын
Which editor do you use?
@JohnWatsonRooney
@JohnWatsonRooney 2 жыл бұрын
This is vs code! But I also use PyCharm
@irfanshaikh262
@irfanshaikh262 2 жыл бұрын
9:45 you dont say
@uzairzarry8691
@uzairzarry8691 5 ай бұрын
Informative
@robinpipslayertekprofitsfa2644
@robinpipslayertekprofitsfa2644 Жыл бұрын
Man, I was following allowing until I hit the console for a 'run' and....😐🥵🥺🤯😭😭 Maybe because I'm using Python 3.7.16 in the current vm, however, I had to create a whole new function 'get_attributes(sef):' for this one line: '''o = Optional[list[str]]''', just so the imported Optional module would work!! Because this method didn't work for me out the box... The main take-away, I now actually get python algorithms a bit more...now if only the OTHER Tutorials were soo "easy" to follow and solve..... 😣😓
@robinpipslayertekprofitsfa2644
@robinpipslayertekprofitsfa2644 Жыл бұрын
nvm...I had to actually create a new vm in -p3.10.10 and it all worked as normal!! What a headache!! Had i not seen the little note in the corner of your screen I would have been lost on which version we was working with 🥲🥲. Lovely lesson though!! Thanks!!
@illegalsmirf
@illegalsmirf 2 жыл бұрын
Christ Almighty, that went over my head a bit
Try THIS Simple Python Decorator (It's Super Useful)
3:37
John Watson Rooney
Рет қаралды 10 М.
How To Use: "@dataclass" In Python (Tutorial 2023)
15:01
Indently
Рет қаралды 30 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 4,8 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 64 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 63 МЛН
Pydantic is the Python Package I Wish I'd Learned Earlier
11:21
John Watson Rooney
Рет қаралды 56 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 190 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 817 М.
Pydantic is OP, here's why
18:10
Carberra
Рет қаралды 24 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 415 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 404 М.
Why *ARGS and **KWARGS are Useful in Python
10:44
John Watson Rooney
Рет қаралды 17 М.
Attrs, Pydantic, or Python Data Classes?
17:10
ArjanCodes
Рет қаралды 88 М.
Python Data Classes Are AMAZING! Here's Why
16:11
Tech With Tim
Рет қаралды 85 М.