Apache Pig: Windows Installation 安装
Prerequisites 先决条件
Apache HadoopApache Pig is a platform build on the top of Hadoop. You can refer to our previously published article to install a Hadoop single node cluster on Windows 10.
7zip/Winrar7zip/Winrar is needed to extract .tar.gz archives we will be downloading in this guide.
Downloading 下载 Apache PigDownload the Apache Pig
After the file is downloaded, we should extract it twice using 7zip (using 7zip: the first time we extract the .tar.gz file, the second time we extract the .ta ...
Hadoop: Windows Installation 安装
Prerequisite
Java JDK 1.8.0
Java development kit can be confirmed that has been installed in your machine through the command javac -version.
Hadoop is only supported with 8 and 11 Java version.
Setup HadoopDownload HadoopDownload Hadoop 3.3.0 (Binary download) and extract with Winrar (Windows) or Keka (Mac). After the hadoop-3.3.0.tar.gz has been downloaded, it has to be extracted to C:\ folder.
Download Hadoop from Apache
Setup Environmental VariablesOpen the System Properties window from C ...
React: Freecodecamp
Create a Simple JSX Element1const JSX = <h1>Hello JSX!</h1>;
Create a Complex JSX Element1234567891011const JSX = ( <div> <h1>Paragraph One</h1> <p>Paragraph Two</p> <ul> <li>a</li> <li>b</li> <li>c</li> </ul> </div>);
Add Comments in JSX1234567const JSX = ( <div> {/* This is a block */} <h1>This is a block of JSX</h1> <p>Here& ...
Python: Lists
ListsLists in Python represent ordered sequences of values.
1primes = [2, 3, 5, 7]
Types of things in list
1planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune']
A list of list
1234567hands = [ ['J', 'Q', 'K'], ['2', '2', '2'], ['6', 'A', 'K'], # (Comma after the last element is opt ...
Pandas: Index, Select, Assign
1234import pandas as pdreviews = pd.read_csv("input/wine-reviews/winemag-data-130k-v2.csv", index_col=0)pd.set_option("display.max_rows", 5)
Look at an overview of your data by running the following line.
1reviews.head()
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
country
description
...
Pandas: Create, Read, Write
Getting StartedTo use pandas, you’ll typically start with the following line of code.要使用 pandas,你通常会从下面这行代码开始。
1import pandas as pd
CreateThere are two core objects in pandas: the DataFrame and the Series.在 pandas 中,有两个核心对象:DataFrame 和 Series。
DataFrameA DataFrame is a table. It contains an array of individual entries, each of which has a certain value. Each entry corresponds to a row (or record) and a column.一个 DataFrame 是一个表。它包含一个单独的条目数组,每个条目都有一定的值。每个条目对应于一个行(或记录)和一个列。
1pd.DataFrame({ ...
Python: Booleans and Conditionals
BooleansPython has a type bool which can take on one of two values: True and False.
123x = Trueprint(x)print(type(x))
True<class ‘bool’>
Comparison OperationsOperation Description Operation Descriptiona == b a equal to b a != b a not equal to ba < b a less than b a > b a greater than ba <= b a less than or equal to b a >= b a greater than or equal to b
1234567def can_run_for_president(age): """Can someone of the given age run for president in the US?"& ...
Python: Functions 功能
Getting Help 寻求帮助You saw the abs function in the previous tutorial, but what if you’ve forgotten what it does?你在前面的教程中看到了 abs 函数,但如果你忘记了它的作用怎么办?
The help() function is possibly the most important Python function you can learn. If you can remember how to use help(), you hold the key to understanding most other function.help()函数可能是你可以学习的最重要的 Python 函数。如果你能记住如何使用 help(),你就掌握了理解大多数其他函数的关键。
Here is an example:下面是一个例子。
1help(round)
12345678Help on built-in function round in module builtins:round(...) ...
源代码储存
git branchHere we can use git’s branching system to work with multiple terminals, so that each time we open a different computer, it’s just a simple configuration and synchronization of files on github, and you can work seamlessly.
The mechanism is this, since the hexo d uploads deployed to github are actually hexo compiled files that are used to generate web pages and do not contain source files.That is, the upload is automatically generated in .deploy_git in the local directory.
Other files, i ...
Python: Hello 你好
IntroductionWe’ll start with a brief overview of Python syntax, variable assignment, and arithmetic operators. If you have previous Python experience, you can skip straight to the hands-on exercise.
Hello, Python!Python was named for the British comedy troupe Monty Python, so we’ll make our first Python program an homage to their skit about Spam?
Just for fun, try reading over the code below and predicting what it’s going to do when run. (If you have no idea, that’s fine!)
Then click the “output ...