Posts

Showing posts with the label Python

Tips for Cybersecurity Students using Python for the First Time

Image
I'm currently doing a Master's in Cybersecurity and one of the class projects use Python to learn more about Cryptography focused around simple implementations of RSA. So for my fellow peers who have never worked with Python before here are my pointers.  This is most relevant for people enrolled in Georgia Tech's CSC 6035 course and working on the Cryptography project. 1) Depending on your OS you may already have a version of Python installed. This can be dangerous as some Python 2 syntax is not compatible with Python 3. To avoid needless headache type into the command line: python --version If it does not report Python 3.x.x. Go and install it. I can't speak for other OSes but for Linux Python 2 & Python 3 can be installed side-by-side with the caveat being I have to explicitly use python3 to run my code. See the output of my system: kinman@yoga-linux:~$ python --version Python 2.7.15+ kinman@yoga-linux:~$ python3 --version Python 3.6.8 kinm...

The 5 Minute Guide to Setup a Raspberry Pi for Bluetooth Development

Image
Pre-requisites The pre-requisite for this guide is to have a stock Raspberry Pi 3 running the latest version of Raspbian. To do this simply: 1) Download the official latest image here . 2) Follow the official instructions to transfer the image to an SD card . Raspberry Pi Development Setup There are three ways to setup your development environment. One option is to hook up an HDMI monitor, keyboard and mouse and develop directly on the Raspberry Pi. The other two options are to use a laptop and remotely connect to the Raspberry Pi either using Ethernet  ( or WiFi ) or serial to USB connection. I strongly recommend purchasing a Raspberry Pi Serial to USB cable  and setting up a serial to USB connection  because it allows you to develop offline, allowing you the freedom to develop in a coffee shop or anywhere because you don't need to have the Raspberry Pi connected to a network.  Raspberry Pi Environment Setup Once you h...

Python Pandas: Replacement method for convert_objects()

Image
The  DataFrames.convert_objects()  in Pandas is a very useful function to try to infer better data types for you imported data. For example if you have just imported hockey player stats and the data looks like: df.dtypes Out[1]:  PLAYER    object TEAM      object GP        object G         object A         object PTS       object +/-       object dtype: object Using convert_objects: df.convert_objects(convert_numeric=True).dtypes  __main__:1: FutureWarning: convert_objects is deprecated.  Use the data-type specific converters pd.to_datetime, pd.to_timedelta and pd.to_numeric. Out[2]:  PLAYER     object TEAM       object GP          int64 G           int64 A           int64 PTS     ...