A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).
Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.
Switch to the master branch and make sure you are up to date:
''' | |
This file converts the hand dataset (https://www.robots.ox.ac.uk/~vgg/data/hands/) to Pascal Format | |
''' | |
import scipy.io as sio | |
from os import listdir | |
from os.path import isfile, join | |
import math | |
from xml.etree import ElementTree as et | |
import cv2 |
""" | |
author: Timothy C. Arlen | |
date: 28 Feb 2018 | |
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific | |
image Ids. Usage: | |
> python calculate_mean_ap.py | |
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output |
# -------------------------------------------------------- | |
# Camera Recorder for Tegra X2/X1 | |
# | |
# This program captures video from IP CAM, USB webcam, | |
# or the Tegra onboard camera, adds some watermark on | |
# the video frames and then records it into a TS file. | |
# The code demonstrates how to use cv2.VideoWriter() | |
# while taking advantage of TX2/TX1's H.264 H/W encoder | |
# capabilities. | |
# |
class MaxHeap: | |
def __init__(self, collection=None): | |
self._heap = [] | |
if collection is not None: | |
for el in collection: | |
self.push(el) | |
def push(self, value): | |
self._heap.append(value) |
from deeplake.util.bugout_reporter import deeplake_reporter | |
from deeplake.client.client import DeepLakeBackendClient | |
def list_deeplake_datasets( | |
org_id: str = "", | |
token: str = None, | |
) -> None: | |
"""List all available Deep Lake cloud datasets. | |
Removed from deeplake in: https://github.com/activeloopai/deeplake/pull/2182/files | |
""" |