Skip to content

Tag: python

Changing the border width of a plot

I have a script to create an easy plot, but I would like to change the border width because it is a little bit transparent. How can I do this? With images is clearer the my problem Answer I changed the size of your plot because it was way too huge for me to work with, just FYI. What you

Find Function in Python

I’ve made this code but it is not acting how I was expecting: Basically I read a .pcap file which can be full of information or empty and I’m looking for a word inside each raw. If it is found I start some operation on this string in order to reach a desidered position inside the string. I noticed…

Manipulating files using Python

My old friend and I have been trying to save our chat histories recently for the nostalgia and the memories. Google chat history saves in a latest-oldest order. I’d like to make it to oldest-latest as well as change the pattern of the text. Any idea how I can implement this in Python? For reference this…

How do I log tqdm console output to a file in Python?

I’m working on a task that requires me to log the console output of tqdm to a file. Using the below snippet tqdm shows progress bars in the console. I used the file parameter to log the output to a file like this: and I’m able to achieve my expected output. However when I use the file param, tqdm …

How can i save the name of objects in python in specific order?

I am trying to save the name of objects as image in specific order. Like if there are seven objects detected in image and their names are [chair, tv, bed, chair ,bed, chair, chair]. I want that it should be saved as [chair.png, chair1.png, chair2.png, chair3.png, bed.png, bed1.png, tv.png]. No matter what obj…

Python, plot matrix diagonal elements

I have an 120×70 matrix of which I want to graph diagonal lines. for ease of typing here, I will explain my problem with a smaller 4×4 matrix. index 2020 2021 2022 2023 0 1 2 5 7 1 3 5 8 10 0 1 2 5 3 1 3 5 8 4 I now want to graph for example