Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
data = {"colA": [1, 2 , 3, 4, 5, 6, 7 ,8],
"colB": ["one", "two", "one", "two", "one", "two", "one", "two"]}
df = pd.DataFrame(data)
# Always use the pattern
# df.loc[<selector>, column_to_change] = value
# selector is usually df['a_column'] == "something"
# the column can be one or more.
@mattions
mattions / INSTALL.md
Created April 17, 2018 20:16 — forked from vfdev-5/INSTALL.md
Jackal simulation in ROS kinetic

Install dependencies :

This is manual way to install necessary packages :

sudo apt-get install ros-kinetic-robot-localization ros-kinetic-controller-manager ros-kinetic-joint-state-controller ros-kinetic-diff-drive-controller ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control ros-kinetic-gazebo-plugins             ros-kinetic-lms1xx ros-kinetic-pointgrey-camera-description ros-kinetic-roslint ros-kinetic-amcl ros-kinetic-gmapping      ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-message-runtime ros-kinetic-topic-tools ros-kinetic-teleop-twist-joy

If you want to use rosdep and install all dependencies (for example for doc generation etc), the skip this step.

Create a workspace and clone sources

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.

@mattions
mattions / matplotlibrc
Last active October 7, 2017 23:58 — forked from huyng/matplotlibrc
Matplotlib style to have a default similar to ggplot2. Inspired by http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
# Upgrade your requirements
# - Finds outdated package with pip
# - install latest stable version
# - Update the requirements with the latest
pip list --outdated | cut -d' ' -f1 | xargs pip install --upgrade
pip freeze > requirements.txt
# blackkiwi - production app
FROM mattions/webber:1.0
MAINTAINER mattions "mattions@gmail.com"
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get -qy install\
python3 \
@mattions
mattions / myapp.py
Created December 18, 2013 18:07
quick embedded Gunicorn app
from gunicorn.app.base import Application, Config
class GUnicornFlaskApplication(Application):
def __init__(self, app):
self.usage, self.callable, self.prog, self.app = None, None, None, app
def run(self, **options):
self.cfg = Config()
[self.cfg.set(key, value) for key, value in options.items()]
@mattions
mattions / python_r_NGS
Created July 26, 2013 15:35
Quick NGS file
{
"metadata": {
"name": "reading stuff in"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mattions
mattions / NGS_notes.ipnb
Last active December 20, 2015 06:39
Notes on the NGS course
{
"metadata": {
"name": "NGS"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mattions
mattions / page_checker.py
Last active December 19, 2015 07:09
Checking if a sentence goes away from a page.
import requests
import time
from datetime import datetime
from bs4 import BeautifulSoup
URL="http://www.plosone.org/search/advanced?pageSize=12&sort=&queryField=author&queryTerm=&unformattedQuery=author%3A%22Michele+Mattioni%22&journalOpt=some&filterJournals=PLoSONE&subjectCatOpt=all&filterArticleTypeOpt=all"
SENTENCE_WHICH_SHOULD_CHANGE="There were no results"
article_out = False