- Видео 16
- Просмотров 28 056
CSPythonForScience
США
Добавлен 10 апр 2021
Hello and welcome to CSPythonForScience. In this channel will show you some projects I'm working on. Hopefully some of this videos will be useful to you and help fill any voids you have in your python science stack journey.
FastAPI Dashboard Python
In this video we will build a simple dashboard using FastAPI, Plotly, TailWindCSS, HTMX, Pandas, and python's builtin os and pathlib modules. This dashboard will
0:00 Introduction
1:08 Project Setup
3:12 OS File Sizes
10:54 Setting Up Templates
15:25 TailWindCSS Setup
23:07 HTMX Setup
27:27 Dashboard Directory Size
31:04 Dashboard Pie Chart
39:39 Dashboard Bar Chart
45:04 Conclusion
0:00 Introduction
1:08 Project Setup
3:12 OS File Sizes
10:54 Setting Up Templates
15:25 TailWindCSS Setup
23:07 HTMX Setup
27:27 Dashboard Directory Size
31:04 Dashboard Pie Chart
39:39 Dashboard Bar Chart
45:04 Conclusion
Просмотров: 190
Видео
Fullstack Python FastAPI and HTMX Part 9
Просмотров 263Месяц назад
In this final part of the series on FastAPI and HTMX, I will show you some nice features of HTMX that enhances the client side user experience when interacting with our sample social media app. Source code: github.com/acswindle/simple_social 0:00 Introduction 0:35 hx-boost 3:44 hx-disabled 6:07 hx-indicator 10:20 infinite scroll 17:52 popup modal 22:17 Conclusion
Fullstack Python with FastAPI and HTMX Part 8: Uploading Pictures
Просмотров 1,1 тыс.Месяц назад
In part 8 of our simple social media web application, we add an upload picture feature to our posts. Source Code github.com/acswindle/simple_social 0:00 Introduction 0:30 Single Page Comments 6:18 Hide Comments 12:37 Post Picture 31:30 Rendering Uploaded Pictures 37:26 Outro
Fullstack Python with FastAPI and HTMX Part 7: Adding Comments
Просмотров 293Месяц назад
In part 7 of our simple social media fullstack python application, we add in a user feature to add comments on a post. Source code : github.com/acswindle/simple_social
Fullstack Python With FastAPI and HTMX Part 6: Adding Like Feature
Просмотров 299Месяц назад
In this video we expand our features for the simple social media site by adding a like feature. 0:00 Introduction 0:21 Updating Database Schema 5:00 Posting Like to Database 10:35 Pulling Like Count per Post 20:11 Like Counter HTML 23:03 Add Like Button HTML 30:39 Updating Post after Liked HTMX 41:43 Disabling Like Unlogged Users 44:31 Showing Used Liked 57:51 Unlike Feature 1:03:18 Conclusion
Full Stack Python with FastAPI and HTMX Part 5: Frontend Refactor
Просмотров 560Месяц назад
In this part 5 of our python full stack social media site with FastAPI and HTMX, we go through and refactor our front end to make it more "dry". This will allow us to add new features much quicker in later parts. We also add some more capabilities to our sign up, log out, and log in features. Source code github.com/acswindle/simple_social 0:00 Introduction 1:26 Base Template 7:07 Resuable User ...
Full Stack Python with FastAPI and HTMX Part 4: Security
Просмотров 760Месяц назад
This is part 4 our our FastAPI w/ HTMX series. Strap up for this one, because in this video we go deep into the discussion of setting up security with user authentication and sessions. Github Repo: github.com/acswindle/simple_social 0:00 Introduction 0:39 Adding Users to Database 4:32 Adding Signup Backend 20:32 Signup Frontend 35:20 Login Authentication 42:00 Login Session Creation 52:50 Using...
Four Reasons Choosing Polars Over Pandas
Просмотров 1092 месяца назад
In this video I want to make the case for why I am choosing to switch to Polars from Pandas and why I think you should consider it as well. Github repo w/ code github.com/acswindle/polars_youtube 0:00 Introduction 2:05 Indexing and Multi-indexing 9:58 Better Declarative API 18:23 Parallelism 23:11 Query Optimization
Full Stack Python FastAPI HTMX Part 3
Просмотров 9462 месяца назад
This is the second in a series of videos detailing making a simple full stack web application using SQLite as a back end database, FastAPI for the HTTP server, and HTMX for the browser front end. In this video we make our draft web page look better by adding CSS using Bulma. Full access to the code available on GitHub. github.com/acswindle/simple_social.git 0:00 Introduction 1:54 Bulma Overview...
Full Stack Python FastAPI HTMX SQLite Part 2
Просмотров 1 тыс.2 месяца назад
This is the second in a series of videos detailing making a simple full stack web application using SQLite as a back end database, FastAPI for the HTTP server, and HTMX for the browser front end. In this video we dive deeper in Jinja 2 templating and getting our front end set up with HTMX. Full access to the code available on GitHub. github.com/acswindle/simple_social.git 0:00 Introduction 0:24...
Full Stack Python Application FastAPI, HTMX, SQLite Part 1
Просмотров 4,5 тыс.2 месяца назад
This is the first in a series of videos detailing making a simple full stack web application using sqlite as a backend database, FastAPI for the HTTP server, and HTMX for the browser frontend. Part 2 ruclips.net/video/oHy4YeMp6Zo/видео.html Full access to the code available on github. github.com/acswindle/simple_social.git 0:00 Introduction 0:19 Setting up project 1:10 Setting up database 3:34 ...
KNN Regression Using Python and Numpy
Просмотров 3452 года назад
In this video I will create a KNN regressor using python and numpy with confidence bands via bootstrapping. I will also use pytest and the python pdb to test and debug the code as I go along. The generated dataset and idea came from The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Second Edition. 00:00 Intro 00:20 Project Setup 04:10 Creating dataset 13:05 Creating ...
Asset Allocation Simulation Using Python and Numpy
Просмотров 5712 года назад
In this video I show how you can use numpy to generate random variables. The application of interest is asset allocation for a profolio made up of hypothetical stocks and bonds. Edit: After uploading I realized I only forcasted to year 24. In order to go to year 25 I should have specified years to 26 due to python's zero based indexing.
Multivariate Normal Modeling in Python Using Numpy
Просмотров 6 тыс.3 года назад
In this video I will go over how to write your own class to to fit data to a multivariate normal distribution. This will be useful for future videos when I cover unsupervised learning topics such as clustering and anomaly detection.
Radial Basis Function Interpolation Nd
Просмотров 2,4 тыс.3 года назад
In this video we extend the radial basis function interpolator class to N dimensions using just python and numpy.
Radial Basis Interpolation From Scratch Using Python
Просмотров 9 тыс.3 года назад
Radial Basis Interpolation From Scratch Using Python
hey man, I got this recommended. I just want to give you advice which is to put all of these parts into a single video. because when I got this recommended I was not interested in this because it's part 8 of the project and I was interested in htmx before but not right now. A big single video works better for the algorithm because of it's length it will have big average view duration (this is why you see a lot of long project videos with high views) and people can come back to it to continue watching and it works better for the recommendation algorithm since people will get to see the whole project's context in one video rather than a random part which they will scroll fast past it. best of luck
That’s a great idea! I’ve been meaning to do so, kind of like freecodecamp type of video. I originally just posted single videos to keep myself motivated, but I should go and collate them into a single vid now that it’s done. Glad you enjoy the content and thank you for the great suggestion!
im following, good content!
Thank you for the kind words!
you know that you can comment a selection with Ctrl + /
Yes, but I had to remap my vscode key bindings awhile back. But I need to go back and correct it so I can quickly comment like you said
Cdn js at the end of a body?
Agreed not the best place for it. In general it’s best to just host your own css and js instead of using cdn. I moved this js cdn into the head in the final vid of the series and show how to use HTMX to cache it so you don’t reload it on every request.
I like this series. The snafu cut on the video is confusing. If I look at step 3 it backs up the posts into temp_posts and then drops and recreates the original posts with foreign keys and. cascades - that makes sense but then why drop the temp_posts table? The Posts are never added back from temp_posts before dropping it! Am I missing something?
Sorry about that. Yes I think you are correct, I never moved the data back from the temp table to the permanent one. I was mainly trying to show how to do the db migration, but forgot that important step!
have you ever tried golang?
No I haven’t but I’ve heard good things about it and would like to try it out sometime. Currently I am learning rust on the side and using it with axum for some hobby projects.
❤❤
Thank you!
first time for me to use bulma. interesting framework!
I like it since you can quickly style the website without too much thought put into it. For a more custom experience, Tailwind is the way to go. I am using that for my next project that I hope to have uploaded here in a couple days, so be to check that out if interested!
What the hell happened at 4:29? Now I'm lost and cannot follow the rest of the vids...
Sorry looks like I accidentally made a cut in post production where I didn’t intend to. All i did was recreate the post table then drop the temp table. It’s the sql statements after the “drop table posts”
very detailed explanation, with full exposure of the developing route. Thank you!
Glad you enjoyed it!
What’s your opinion on fastHtml?
I haven't tried it out yet, but my initial impression isn't too strong. It seems like the main selling point is that everything is done using only python, however I don't see a huge advantage in that. I usually like abstractions when it hides implementation details by exposing a declarative API. That's why I prefer to stick with straight SQL instead of ORM. SQL is a declarative way of dealing with a database while the implementation details are left to the DBMS. I feel like an ORM just tries to abstract something that's already been abstracted away to begin with. Same applies to HTML. Its a declarative way to state how you want a webpage to be displayed, and the implementation details are left to the browser. Trying to abstract HTML into python just doesn't make sense to me. Plus looking at the codebase for FastHTML, it doesn't look like its written in a manner to provide decent type hinting when making the HTML components. They use *args and **kwargs, which makes less than an ideal developer experience when you forget an attribute name. Whereas writing HTML in a modern IDE basically just writes itself due to the really great code completion.
I tried to add some corrections, but youtube will not let me post code. There are number of spots that could really benefit from clarification. In several places code just appears that we did not see you type out. and it is only when things do not work that you realize that it is on screen somewhere.
Yes there a few spots where I detected a minor bug from one video to the next. Unfortunately since these videos go quite long, I decided to make some corrections off camera. Overall I tried to minimize this where possible. My hope is that since the code is available on GitHub, that can be referenced as a “source of truth” so to speak. I will try to improve this as I make future videos. Or if there are spots were I do change the code off camera I will at the least annotate it on the screen .
@@cspythonforscience yes annotations on screen is what I was thinking too. Something like see file.py on github/bahba;h, line xx to xx before continuing. Very happy to help with the effort by sending you time stamps and missing lines. This is a great series and I would like to support your effort.
@@adamwasserman4934 That would be awesome!
And thanks for a great tutorial
Glad you liked it!
A tip for people who are getting just the h1 and not content at 4:00 minutes: on line 24 change `context={}` to `context = context`
Thanks for pointing this out.
@@cspythonforscience My pleasure. There are few spots in the other episode where I will fill in something I think is missing. I really appreciate you making this. Just what I needed, and not that easy to find.
Interesting
Discovered these while searching for interesting new fastapi tutorials. Looks informative tbh. Haven't watched yet but planning to start. Thanks.
Hope you enjoy them! I think fastapi and htmx are a killer combo to get something off the ground fast. I also have the source code uploaded on GitHub. Cheers!
Loving this tutorial!
Glad you liked it!!
Love this series!
Thank you!
Really good - been following. Will code for this video be uploaded?
Yes! Sorry I forgot, I will upload when I get back home today. I currently am a bit ahead of this video on my codebase, but you can go through the git history to get back to the code at this point of the series.
Github updated. github.com/acswindle/simple_social
loving this series! please keep it coming.
Glad you have enjoyed it, hoping to post part 5 soon!
I enjoyed it. Keep it up brother!
Glad you enjoyed it, thank you!
Again great tutorial. I'll keep coming back!
Thank you for the kind words. I hope to have part four uploaded soon
Good job! Clear explanation and the right pace!
Very good tutorial. Great!
one of the best and most well-paced videos I've ever seen on the topic. Please post more often!
Thank you for the kind words! I hope to have part 3 uploaded within the next few days
Well, when is the part 3? :))
Soon!
When will part 2 be? :)
Part 2 is out! Full Stack Python FastAPI HTMX SQLite Part 2 ruclips.net/video/oHy4YeMp6Zo/видео.html Sorry still a RUclips noobie, I will try to add a card and link it to this video when I get home
@@cspythonforscience thx!
You can't understand!. I really mean (thankyou).
I love that you showed a example of RBF interpolation! Bravo! But you gave me yet another example of why I HATE Python! I could’ve done the same thing in half as many lines with Matlab (Octave if you are poor or cheap), and a human could actually read it and understand what was going on. But nonetheless thanks for the example! Oh, also turn up your volume! I could only barely hear you! That made the video actually a bit painful😢
useful, thank you
this does not make sense at all. the voiceover doesn't match what is being typed.
This is amazing
Thank you for sharing this. I was able to follow well but I got confused near the end. The plot_interp function contains the line y = func(data) and func contains the function that generated the data. To me it looks like there is no interpolation happening. Instead, the 'target' function is being used to generate more data.
The 'func' has been passed as an argument in the plot_interp function. RBF 'interp' was then called into the plot_interp function in the last cell.
Will this code work with multi-dimensional data?
No this is only for one dimensional data. However I do have another video with this same algorithm in multidimensional space
Nice video! Could you please post the code as a link in the description? Much appreciated!
You are a legend. Thank you!
I'm using pycharm and following along, interpreter didn't give me any issues but I can't see anything, turns out I need to add a plt.show() after plotting, hope this helps anyone else .
YOUR VOICE IS TOO LOW.
Can you explain the ensue portion around 6:36 of the video? Awesome tutorial by the way
Are you talking about the einsum method?
@@cspythonforscience Yes, I would like an explanation of the selection of the unit vectors used and why. The data set I am trying to apply this to is a 2d numpy array (256,256). It seems that either my data needs to be restructured, or the functions need to be altered. Thank you for your time
@@brianmunson4861 Ok I will try to upload a new video soon talking about it, hopefully within the next week. Here is the article I read that really explained how to do einsum, at least for me. rockt.github.io/2018/04/30/einsum It makes doing dot products, transpositions, and summations with higher dimensional array much easier. Thank you for the kind words!
PER ITALIANI: Ho realizzato una playlist sulle reti RBF! :) quì -> ruclips.net/video/fcBz-3NchCI/видео.html
Hi! I like the video, but the sound is to low, is there a way to raise the volume? (my laptop was at 100, I had to connect a radio to be able to listen > . < )
Yes the settings were wrong on my laptop. I recently figured out how to change the mic sensitivity settings so it should work better in future uploads. I don't think I can fix the existing videos, sorry about that.
Great explanation!
Thank you!
how did u chose epsilon as 2? how do u choose epsilon
If you have the function you are interpolating, you could take a samples from it at a smaller interval than what you constructed the interpolation with. Then you can build a metric, such as residual squares for multiple epsilon values. Then choose the epsilon that minimizes the error. That's what I would do. I might research the topic more and post a video. Hope this helps
Can you provide more insight on the probability plot. I kinda felt it was a bit quick and couldnt apprehend it fully.
Yes sorry I sort of went though it fast or otherwise the video was going to be really long. For contour plots I recommend checking this link out. It is where I learned how to make these plots. Hope this helps! jakevdp.github.io/PythonDataScienceHandbook/04.04-density-and-contour-plots.html