-
Transforming from dict to separate columns
I queried, some time ago, trace route info for IP’s in a list and took the wrong decision to save it in the following form. At first sight it’s not really an issue but if you want to retrieve it and create a dataframe it will look not as expected. Here is the actual code…
-
Plotting unique values in a dataframe column
Today, I began experimenting with a Kaggle dataframe for the first time. Here is the link to it: https://www.kaggle.com/datasets/open-powerlifting/powerlifting-database To make a long story short, if you want to plot the count for each individual column and capture the unique values of a particular column inside that dataframe, you can simply achieve it by using the…
-
Getting unique IP from mongoDB and use it for traceroute query
Hi, Some time ago, I tried to write some python code in order to grab each unique IP from my traffic logs and trying to trace it so that We can find similar nodes which were used for the jumps. This is also a good exercise in order to improve the basic dataframe information and…
-
Fixing “local issuer certificate” in Python
I am putting this here more as a reference since this error appeared a couple of time when using urllib library. For example there is the classical case of And if you run it for the first time in your Jupyter Kernel, it will return The easiest way to fix it is by adding two…
-
Using line_profiler in Python
Currently I am reading one of the chapters from Python Data Science Handbook and saw that there are some magic commands that can be used in IPython. One of them gives you the possibility to time the execution and it’s called %timeit. Going further it seems that there are other commands like %prun but it…
-
Kafka_consumer.yaml (python style) and more
Hi, As a followup to the article i posted earlier ( https://log-it.tech/2019/03/15/get-the-info-you-need-from-consumer-group-python-style/ ) , you can use that info to put in into kafka_consumer.yaml for Datadog integration. It’s not elegant by any means, but it works. As an advise, please don’t over complicate thinks more than they need. In the last example i figured i…
-
Python dictionary construction from process list
Hi, This is out of my expertise but i wanted to shared it anyways. One colleague wanted to help him with the creation of a pair key:value from one command that lists the processes, in python. With a little bit of testing i came to the following form: import os import subprocess from subprocess import…
-
Installing Jupyter Notebook on Raspberry PI 2
Morning, Just want to share you that i managed to install the Jupyter Notebook(http://jupyter.org) on a Raspberry PI 2 without any real problems. Beside a microSD card and a Raspberry you need to read this and that would be all. So, you will need a image of Raspbian from https://www.raspberrypi.org/downloads/raspbian/ (i selected the lite version…