This code snippet shows you how you can return two values from pandas apply function and assign to two new columns.

There are two methods:

  • Use result_type expand
  • Use Series

Installing Conda:

Update packages:

sudo apt-get update

If you don’t have curl, install it:

sudo apt-get install curl

Download the latest Anaconda version from the website (https://www.anaconda.com/products/individual)

cd /tmp
curl -O https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh

Run Anaconda script (the default location is /home/<username>/anaconda3)

bash Anaconda3-2020.11-Linux-x86_64.sh

Initialize

source ~/.bashrc

Check if it is working:

conda -V

You should see the version:

conda 4.9.2

Updating conda:

conda update conda
conda update anaconda

Creating a Conda Env:

Create:

conda create --name py3 python=3

Activate:

conda activate py3

Deactivate:

conda deactivate

Installing packages:

conda install <package-name>[=version]

Version is optional.


Make sure each sub-list in the list has the same number of elements in the same order.

In this example, I create a list of three fields: name, subject and marks. Then append them to the list.

Then, you can directly convert a list of lists into a DataFrame using the from_records method.


Population — Collection of all items we are interested in and you want to draw conclusions about.

Population1: All undergraduate students at Purdue University

Population2: All undergraduate students in USA

Sample Any subset of the population that you use to draw conclusions about the population.

Sample1: Freshmen from population 1

Sample2: A random set of undergraduates from population 1

Sample3: Undergraduates from IVL colleges from population 1

Statistic — A characteristic of a sample (e.g. sample mean)

Parameter — A characteristic of a population (e.g. population mean)

In statistics, we want to know about the population, but it is…


  1. How many elephants do you see in this picture?

There are 3 elephants, I hear you say.

2. How many elephants are there in the world in total?

There are around 450K elephants around the world. (So, there are not endangered species. At least for now.)

Are these statistical questions?

In the first question, we simply say what we see. So, it is definitely not a statistical question.

How about the second question then? It goes beyond what we see in the picture. But it is still not a statistical question.

Then what are they? They are analytical questions. You…


Make sure you have brew installed first. Use this command, if not:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install python:

brew install python

This will install python 3.8


We are a collection of habits.

Brendon lays out three habits of high performers.

Three habits of high performers

Here’s the command line to do so:

python -m json.tool <json_file>

Handling errors:

You may see the following error message:

Expecting property name enclosed in double quotes

This is because your JSON file is using single quotes. Convert them to double quotes.

cat <json_file> | sed s/\'/\"/g > json_file_updated

Some additional pipes:

Check the first 10 json strings:

python -m json.tool <json_file> | head -n 10

Check the 10th json string:

python -m json.tool <json_file> | head -n 10 | tail -n 1

Chances are that you got to know about N95 due to the current pandemic.

But did you realize what is special about N95 masks? Why is it called N95?

N95 masks are not a filter that stops for example flies entering a house, but it is like a cobweb where tiny particles stick to it to block them.

Resurface of Glupteba malware strain

  • Glupteba “mines” cryptocurrencies like Bitcoin on an infected machine and then exfiltrates digital currency.
  • Its latest incarnation also seeks to steal data too. Glupteba is evolving, and its creators are using rarely-seen development techniques to heighten its malicious impact.
  • The backdoor mostly has standard capabilities, but one interesting feature stands out: This malware can update its C&C server address through the blockchain via the function discoverDomain.

Amazon CloudFront CDN is vulnerable to card skimming exploit

  • Card skimmers aim to exfiltrate credit-card data at online point-of-sale.
  • Card-skimmers (possibly from the “Magecart” hacker group) are hiding skimmer…

Digestize

#probability #statistics #ML #DL #coding #security #building #digest

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store