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)
| Wine | Alcohol | Malic.acid | Ash | Acl | Mg | Phenols | Flavanoids | Nonflavanoid.phenols | Proanth | Color.int | Hue | OD | Proline | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 14.23 | 1.71 | 2.43 | 15.6 | 127 | 2.8 | 3.06 | .28 | 2.29 | 5.64 | 1.04 | 3.92 | 1065 | |
| 1 | 13.2 | 1.78 | 2.14 | 11.2 | 100 | 2.65 | 2.76 | .26 | 1.28 | 4.38 | 1.05 | 3.4 | 1050 | |
| 1 | 13.16 | 2.36 | 2.67 | 18.6 | 101 | 2.8 | 3.24 | .3 | 2.81 | 5.68 | 1.03 | 3.17 | 1185 | |
| 1 | 14.37 | 1.95 | 2.5 | 16.8 | 113 | 3.85 | 3.49 | .24 | 2.18 | 7.8 | .86 | 3.45 | 1480 | |
| 1 | 13.24 | 2.59 | 2.87 | 21 | 118 | 2.8 | 2.69 | .39 | 1.82 | 4.32 | 1.04 | 2.93 | 735 | |
| 1 | 14.2 | 1.76 | 2.45 | 15.2 | 112 | 3.27 | 3.39 | .34 | 1.97 | 6.75 | 1.05 | 2.85 | 1450 | |
| 1 | 14.39 | 1.87 | 2.45 | 14.6 | 96 | 2.5 | 2.52 | .3 | 1.98 | 5.25 | 1.02 | 3.58 | 1290 | |
| 1 | 14.06 | 2.15 | 2.61 | 17.6 | 121 | 2.6 | 2.51 | .31 | 1.25 | 5.05 | 1.06 | 3.58 | 1295 | |
| 1 | 14.83 | 1.64 | 2.17 | 14 | 97 | 2.8 | 2.98 | .29 | 1.98 | 5.2 | 1.08 | 2.85 | 1045 |
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)
| # Hadoop Properties | |
| export HADOOP_PREFIX=/usr/local/hadoop # installation location | |
| export HADOOP_HOME=$HADOOP_PREFIX | |
| export HADOOP_COMMON_HOME=$HADOOP_PREFIX | |
| export HADOOP_CONF_DIR=$HADOOP_PREFIX/etc/hadoop | |
| export HADOOP_HDFS_HOME=$HADOOP_PREFIX | |
| export HADOOP_MAPRED_HOME=$HADOOP_PREFIX | |
| export HADOOP_YARN_HOME=$HADOOP_PREFIX | |
| export PATH=$PATH:$HADOOP_PREFIX/bin |
about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar.
Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and
rendering normally. Some settings may also make firefox unstable.
I am not liable for any damages/loss of data.
Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions
(HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".
| sudo: required #is required to use docker service in travis | |
| language: php #can be any language, just php for example | |
| services: | |
| - docker # required, but travis uses older version of docker :( | |
| install: | |
| - echo "install nothing!" # put your normal pre-testing installs here |
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
| #quotes on json, single around entire object and double on each property | |
| aws lambda update-function-configuration --function-name=[lambda function name] --environment '{"Variables":{"abc":"124"}}' |
| nginx: | |
| restart: always | |
| build: ./nginx | |
| ports: | |
| - "80:80" | |
| volumes: | |
| - /www/static | |
| volumes_from: | |
| - web | |
| links: |
| # A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda | |
| # and can be used for developing/testing Python 3.6 Lambda functions | |
| # This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python | |
| # This is required because Amazon Linux does not come with Python 3.6 pre-installed | |
| # and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime | |
| # The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm) | |
| # running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3 | |
| # and was developed with the help of AWS Support |