Skip to content

Python POST request for web scraping

I am using beautifulsoup and requests to scrape html contents for this webpage. Based on the selection made in the page — a list of stations is populated in the page. Clicking on any one station renders an html page with td values. For e.g. My objective is to get data for each station from the list. I a…

Can CNN do better than pretrained CNN?

With all I know. pretrained CNN can do way better than CNN. I have a dataset of 855 images. I have applied CNN and got 94% accuracy.Then I applied Pretrained model (VGG16, ResNet50, Inception_V3, MobileNet)also with fine tuning but still i got highest 60% and two of them are doing very bad on classification. …

Read excel file in python using pandas

I am trying to read excel file in pycharm using pandas. I installed the package successfully. My issue is that I am trying to use file location in addition to its name I tried many thing as follow: However I keep receiving the following error Any Idea? Thanks in advance Answer Your fileLocation variable inclu…

How to use Django session variable in models.py

I wanna use the Django session variable on models.py file. How can I do it? I want to get the user’s Pincode/zip and have to run a query using that. I need to get Pincode from the session. Answer In your model method you don’t have access to the request so you do not have access to the session. On…

Type hints for a pandas DataFrame with mixed dtypes

I’ve been looking for robust type hints for a pandas DataFrame, but cannot seem to find anything useful. This question barely scratches the surface Pythonic type hints with pandas? Normally if I want to hint the type of a function, that has a DataFrame as an input argument I would do: What I cannot seem…

How to import package in module

I’m new to Python, and I try to structure my Python application. Given the following directory structure: Right now, the application is executed using the following command: When I try to execute the application using The following error is raised: Unit tests are being executed using: This works fine an…