python
get rotation angle between two vectors
Getting the angle between two vectors is well known. But finding the ‘rotation angle’ from one vector to another needs a bit more consideration. The following functions can handle this. This function will use cross product between two vectors to identify if the rotation direction is CW or CCW. This Read more…
python
visual code python debugging configuration
creating the most basic launch.json file is explained well in official docs. changing execution path However what I really wanted to know was how to configure it to make it run debugging on a file from a specific directory path. For example, I have a workspace structure like this. And Read more…
python
adding pip config file in virtualenv
after creating a virtualenv, one can setup pip.conf file right inside the created virtualenv directory. Here’s an example An example of pip.conf that I use commonly is shown below. The “index-url” may not be necessary since it is the default value, but in case it is overwritten by the system Read more…
python
apply proxy settings to python requests
you can apply proxy settings to python requests like this:
python
reading yaml files in python
instlal PyYAML in python file, load file like the following the data in yaml file will be saved in data variable as a python dict.
python
python encode string to percent encoded(urlencode) format
reference: https://www.urlencoder.io/python/
python
matplotlib draw heatmap figure with colorbar
here is the sample code for drawing a single axis in a figure. The above is the result. I have tried to create several subplots and add heatmap to each one with individual colorbars on its side, but it seems this is hard to implement.
python
None index in python list?
while looking through some deep learning implementation code, I found some strange list indexing in python code. Here is an example. It was using None as an index when indexing a python object. First I thought is this indexing None on a python list and tested it. But it gave Read more…