Python Vocabularies
Python Vocabularies
itemgetter
SQL select from table having is the where clause when grouo by is used
remove a column
The NOT NULL constraint will not allow adding a null value
to a column. In our table employees, we can make the age
column a not null one.
default constraint
combining constraints
Data type
int_ or int32 or int64
int8
int16
int32
int64
uint8
uint16
uint32
uint64
Numpy Datatypes
Data type
float16
float32
float_or float64
float128
Exception
SyntaxError
TypeError
ValueError
OSError
ImportError
EOFError
NameError
IndexError
Method
assertEqual(a, b)
assertNotEqual(a, b)
assertTrue(x)
assertFalse(x)
assertIs(a, b)
assertIsNot(a, b)
assertIsNone(x)
assertIsNotNone(x)
assertIn(a, b)
assertNotIn(a, b)
assertIsInstance(a, b)
assertNotIsInstance(a, b)
Python
dict
list, tuple
str
int, float
1
0
None
debugger Command
p
pp
n
c
unt
ll
b
u
d
h
h <topic>
h pdb
q
POS
NLTK Pos Tagging
Adjective
Adjective, comparative
Superlative adjective
Reflexive pronoun
NLTK Method
raw()
words()
sents()
paras()
readme()
Method
tagged_words()
tagged_sents()
tagged_paras()
chunks()
chunked_sents()
parsed_sents()
parsed_paras()
categories()
datetime.strftime() Code
https://strftime.org/ %a
%A
%w
%d
%-d
%b
%B
%m
%-m
%y
%Y
%H
%-H
%I
%-I
%p
%M
%-M
%S
%-S
%f
%z
%Z
%j
%-j
%U
%W
%c
%x
%X
%%
Pattern
Single Underscore
Passing a mutable object such as a list, dict, or set acts somewhat—but not exactly—like pass-by-ref
changes will be reflected in the calling environment.
Memorization Target
{key: value for variable in iterable} where key and value can be written as a expression with variable
when returning multiple objects inside a function, expression_1 and expression_2 is put into a set
which we can then iterate
NA
Return a callable object that fetches item from its operand using the operand’s __getitem__() method.
If multiple items are specified, returns a tuple of lookup values. For example:
items are index, obj is what the operator applies to, operator.__getitem__(a, b).
def itemgetter(*items):
if len(items) == 1:
item = items[0]
def g(obj):
return obj[item]
else:
def g(obj):
return tuple(obj[item] for item in items)
return g
SELECT
col1 [AS alias1], ..., colN [AS aliasN]
FROM
table_name
;
SELECT
expr1 [AS alias1], ..., exprN [AS aliasN]
FROM
table_name
WHERE
logical_expression
;
SELECT AGG_FUNCTION(column_name) FROM table_name;
SELECT COUNT(DISTINCT yesterday_deals) FROM stocks;
SELECT product
FROM products
WHERE price BETWEEN 8 AND 13;
SELECT product
FROM products
WHERE price IN (10, 12, 16)
SELECT product
FROM products
WHERE product LIKE '%a%';
or where products like _a_
SELECT column_name(s)
FROM table_name
WHERE EXISTS
(SELECT column_name FROM table_name WHERE condition);
SELECT *
FROM persons
WHERE city IS DISTINCT FROM 'New-York';
UPDATE table_name SET col1 = expr1, col2 = expr2, …, colN = expr WHERE logical_expression;
CREATE DATABASE students;
CREATE TABLE students_info (
student_id INT,
name VARCHAR(30),
surname VARCHAR(30),
age INT
);
DROP DATABASE students;
DROP TABLE students_info;
INSERT INTO customers (name, surname, zip_code, city) VALUES ('Bobby', 'Ray', 60601, 'Chicago');
Description
Integer type set by default (depends on a user's operation system)
Integers ranging from -128 to 127
Integers ranging from -32 768 to 32 767
Integers ranging from -2 147 483 648 to 2 147 483 647
Integers ranging from -9 223 372 036 854 775 808 to 9 223 372 036 854 775 807
Non-negative integers ranging from 0 to 255
Non-negative integers ranging from 0 to 65 535
Non-negative integers ranging from 0 to 4 294 967 295
Non-negative integers ranging from 0 to 18 446 744 073 709 551
Description
Half-Precision Floating-Point Format (2 Bytes)
Single-Precision Floating-Point Format (4 bytes)
Double-Precision Floating-Point Format (8 bytes)
Quadruple-Precision Floating-Point Format (16 bytes)
BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- StopIteration
+-- StopAsyncIteration
+-- ArithmeticError
| +-- FloatingPointError
| +-- OverflowError
| +-- ZeroDivisionError
+-- AssertionError
+-- AttributeError
+-- BufferError
+-- EOFError
+-- ImportError
| +-- ModuleNotFoundError
+-- LookupError
| +-- IndexError
| +-- KeyError
+-- MemoryError
+-- NameError
| +-- UnboundLocalError
+-- OSError
| +-- BlockingIOError
| +-- ChildProcessError
| +-- ConnectionError
| | +-- BrokenPipeError
| | +-- ConnectionAbortedError
| | +-- ConnectionRefusedError
| | +-- ConnectionResetError
| +-- FileExistsError
| +-- FileNotFoundError
| +-- InterruptedError
| +-- IsADirectoryError
| +-- NotADirectoryError
| +-- PermissionError
| +-- ProcessLookupError
| +-- TimeoutError
+-- ReferenceError
+-- RuntimeError
| +-- NotImplementedError
| +-- RecursionError
+-- SyntaxError
| +-- IndentationError
| +-- TabError
+-- SystemError
+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError
+-- Warning
+-- DeprecationWarning
+-- PendingDeprecationWarning
+-- RuntimeWarning
+-- SyntaxWarning
+-- UserWarning
+-- FutureWarning
+-- ImportWarning
+-- UnicodeWarning
+-- BytesWarning
+-- ResourceWarning
Explanation
Raised when some statement uses the wrong syntax.
Raised when any operation/function is applied to an object of inappropriate type.
Raised when any operation/function accepts an argument with an inappropriate value.
Checks that
a == b
a != b
bool(x) is True
bool(x) is False
a is b
a is not b
x is None
x is not None
a in b
a not in b
isinstance(a, b)
not isinstance(a, b)
JSON
object
array
string
number
1
0
null
Description
Print the value of an expression.
Pretty-print the value of an expression.
Continue execution until the next line in the current function is reached or it
returns.
Execute the current line and stop at the first possible occasion (either in a function
that is called or in the current function).
Continue execution and only stop when a breakpoint is encountered.
Continue execution until the line with a number greater than the current one is
reached. With a line number argument, continue execution until a line with a
number greater or equal to that is reached.
List source code for the current file. Without arguments, list 11 lines around the
current line or continue the previous listing.
List the whole source code for the current function or frame.
With no arguments, list all breaks. With a line number argument, set a breakpoint
at this line in the current file.
Print a stack trace, with the most recent frame at the bottom. An arrow indicates
the current frame, which determines the context of most commands.
Move the current frame count (default one) levels up in the stack trace (to an
older frame).
Move the current frame count (default one) levels down in the stack trace (to a
newer frame).
See a list of available commands.
Show help for a command or topic.
Show the full pdb documentation.
Quit the debugger and exit.
Penn Treebank
JJ
JJR
JJS
VBG
VBP\VBZ
VB
Application
Accesses a raw text from a plain corpus.
Divides a corpus into words.
Divides a corpus into sentences.
Divides a corpus into paragraphs.
Accesses a README file for a corpus, if found.
Application
Displays each word in a text with its POS tag.
Displays each word in a sentence with its POS tag.
Displays each word in a paragraph with its POS tag.
Accesses the whole corpus broken into chunks.
Displays chunk structures for a sentence.
Shows the syntactic structure for a sentence.
Shows syntactic structure for sentences in a paragraph.
Shows categories, such as genres or polarity values.
Meaning
Weekday as locale’s abbreviated name.
Weekday as locale’s full name.
Weekday as a decimal number, where 0 is Sunday and 6 is Saturday.
Day of the month as a zero-padded decimal number.
Day of the month as a decimal number. (Platform specific)
Month as locale’s abbreviated name.
Month as locale’s full name.
Month as a zero-padded decimal number.
Month as a decimal number. (Platform specific)
Year without century as a zero-padded decimal number.
Year with century as a decimal number.
Hour (24-hour clock) as a zero-padded decimal number.
Hour (24-hour clock) as a decimal number. (Platform specific)
Hour (12-hour clock) as a zero-padded decimal number.
Hour (12-hour clock) as a decimal number. (Platform specific)
Locale’s equivalent of either AM or PM.
Minute as a zero-padded decimal number.
Minute as a decimal number. (Platform specific)
Second as a zero-padded decimal number.
Second as a decimal number. (Platform specific)
Microsecond as a decimal number, zero-padded on the left.
UTC offset in the form +HHMM or -HHMM (empty string if the the object is naive).
Time zone name (empty string if the object is naive).
Day of the year as a zero-padded decimal number.
Day of the year as a decimal number. (Platform specific)
Week number of the year (Sunday as the first day of the week) as a zero padded decimal number.
All days in a new year preceding the first Sunday are considered to be in week 0.
Week number of the year (Monday as the first day of the week) as a decimal number. All days in a
new year preceding the first Monday are considered to be in week 0.
Locale’s appropriate date and time representation.
Locale’s appropriate date representation.
Locale’s appropriate time representation.
A literal '%' character.
Example
_var
var_
__var
__var__
as follows. Passing an immutable object, like an int, str, tuple, or frozenset, to a Python function acts like pass-by-value. The function can’t
t acts somewhat—but not exactly—like pass-by-reference. The function can’t reassign the object wholesale, but it can change items in pla
ent.
Example
NA
FROM
WHERE
GROUP BY
HAVING
SELECT
ORDER BY
SELECT product
FROM products
WHERE (price >= 8 AND price <= 13);
3.1
3.1
3.1
3.1
3.1
3.1
3.2
3.2
LOB Example
Brown Corpus BNC2
Corpus s
gorgeou
JJ JJ AJ0 s,
attractive
VBZ (3rd
VBP\VBZ person VBB see, goes
singular)
273
273
39
39
Meaning
Naming convention indicating a name is meant for internal
use. Generally not enforced by the Python interpreter
(except in wildcard imports) and meant as a hint to the
programmer only.
Used by convention to avoid naming conflicts with Python
keywords.
Triggers name mangling when used in a class context.
Enforced by the Python interpreter.
sale, but it can change items in place within the object, and these
_
Added in Java 9, the underscore has become a keyword and cannot be used as a variable name anymore.[3]
abstract
A method with no definition must be declared as abstract and the class containing it must be declared as abstract
classes. The abstract keyword cannot be used with variables or constructors. Note that an abstract class isn't req
Assert describes a predicate (a true–false statement) placed in a Java program to indicate that the developer thin
an assertion failure results, which typically causes execution to abort. Optionally enable by ClassLoader method.
boolean
Defines a boolean variable for the values "true" or "false" only. By default, the value of boolean primitive type is false. This
break
byte
The byte keyword is used to declare a field that can hold an 8-bit signed two's complement integer.[5][6] This keywo
case
catch
Used in conjunction with a try block and an optional finally block. The statements in the catch block specify w
char
Defines a character variable capable of holding any character of the java source file's character set.
class
A type that defines the implementation of a particular kind of object. A class definition defines instance and class
and the immediate superclass of the class. If the superclass is not explicitly specified, the superclass is implicitly O
without needing an instance of that class. For example, String.class can be used instead of doing new String().
const
continue
Used to resume program execution at the end of the current loop body. If followed by a label, continue resumes
default
The default keyword can optionally be used in a switch statement to label a block of statements to be executed
can also be used to declare default values in a Java annotation. From Java 8 onwards, the default keyword can
do
The do keyword is used in conjunction with while to create a do-while loop, which executes a block of statement
the expression evaluates to true, the block is executed again; this continues until the expression evaluates to fa
double
The double keyword is used to declare a variable that can hold a 64-bit double precision IEEE 754 floating-point
type double.[7][8]
else
The else keyword is used in conjunction with if to create an if-else statement, which tests a boolean expression
evaluated; if it evaluates to false, the block of statements associated with the else are evaluated.[13][14]
A Java keyword used to declare an enumerated type. Enumerations extend the base class Enum.
extends
Used in a class declaration to specify the superclass; used in an interface declaration to specify one or more supe
to class Y, or by overriding methods of class Y. An interface Z extends one or more interfaces by adding methods
interfaces it extends.
Also used to specify an upper bound on a type parameter in Generics.
final
Define an entity once that cannot be changed nor derived from later. More specifically: a final class cannot be sub
a left-hand expression on an executed command. All methods in a final class are implicitly final.
finally
Used to define a block of statements for a block defined previously by the try keyword. The finally block is exe
whether an exception was thrown or caught, or execution left method in the middle of the try or catch blocks us
float
The float keyword is used to declare a variable that can hold a 32-bit single precision IEEE 754 floating-point nu
type float.[7][8]
for
The for keyword is used to create a for loop, which specifies a variable initialization, a boolean expression, and a
expression is evaluated. If the expression evaluates to true, the block of statements associated with the loop are
evaluated again; this continues until the expression evaluates to false.[15]
As of J2SE 5.0, the for keyword can also be used to create a so-called "enhanced for loop",[16] which specifies an
statements using a different element in the array or Iterable.[15]
goto
Unused
if
The if keyword is used to create an if statement, which tests a boolean expression; if the expression evaluates t
can also be used to create an if-else statement; see else.[13][14]
implements
Included in a class declaration to specify one or more interfaces that are implemented by the current class. A class inherits
import
Used at the beginning of a source file to specify classes or entire Java packages to be referred to later without inc
import static members of a class.
instanceof
A binary operator that takes an object reference as its first operand and a class or interface as its second operand and prod
int
The int keyword is used to declare a variable that can hold a 32-bit signed two's complement integer.[5][6] This key
interface
Used to declare a special type of class that only contains abstract or default methods, constant (static final) f
with the implements keyword. As multiple inheritance is not allowed in Java, interfaces are used to circumvent it.
long
The long keyword is used to declare a variable that can hold a 64-bit signed two's complement integer.[5][6] This ke
native
Used in method declarations to specify that the method is not implemented in the same Java source file, but rather in anot
new
Used to create an instance of a class or array object. Using keyword for this end is not completely necessary (as exemplified
non-sealed
Used to declare that a class or interface which extends a sealed class can be extended by unknown classes.[17]
package
Java package is a group of similar classes and interfaces. Packages are declared with the package keyword.
private
The private keyword is used in the declaration of a method, field, or inner class; private members can only be accessed by o
protected
The protected keyword is used in the declaration of a method, field, or inner class; protected members can only
same package.[18]
public
The public keyword is used in the declaration of a class, method, or field; public classes, methods, and fields can be accesse
return
Used to finish the execution of a method. It can be followed by a value required by the method definition that is re
short
The short keyword is used to declare a field that can hold a 16-bit signed two's complement integer. [5][6] This keyw
static
Used to declare a field, method, or inner class as a class field. Classes maintain one copy of class fields regardless of how m
A Java keyword used to restrict the precision and rounding of floating point calculations to ensure portability.[8]
super
Inheritance basically used to achieve dynamic binding or run-time polymorphism in java. Used to access members of a class
switch
synchronized
Used in the declaration of a method or code block to acquire the mutex lock for an object while the current thread
that at most one thread at a time operating on the same object executes that code. The mutex lock is automatica
cannot be declared as synchronized.
this
Used to represent an instance of the class in which it appears. this can be used to access class members and a
one constructor in a class to another constructor in the same class.
throw
Causes the declared exception instance to be thrown. This causes execution to continue with the first enclosing e
exception type. If no such exception handler is found in the current method, then the method returns and the proc
the stack, then the exception is passed to the thread's uncaught exception handler.
throws
Used in method declarations to specify which exceptions are not handled within the method but rather passed to
instances of RuntimeException must be declared using the throws keyword.
transient
Declares that an instance field is not part of the default serialized form of an object. When an object is serialized,
representation. When an object is deserialized, transient fields are initialized only to their default value. If the defa
hierarchy, all transient keywords are ignored.[19][20]
try
Defines a block of statements that have exception handling. If an exception is thrown inside the try block, an opt
be declared that will be executed when execution exits the try block and catch clauses, regardless of whether a
a finally block.
void
The void keyword is used to declare that a method does not return any value.[7]
volatile
Used in field declarations to guarantee visibility of changes to variables across threads. Every read of a volatile variable will
while
The while keyword is used to create a while loop, which tests a boolean expression and executes the block of st
expression evaluates to false. This keyword can also be used to create a do-while loop; see do.[11][12]
long 8 bytes
float 4 bytes
double 8 bytes
boolean 1 bit
char 2 bytes
&& - AND || - OR
! - NOT
e condition. The method returns true if the next element exists and false otherwise.
Example
string prefix,
ng suffix, otherwise, false.
r character;
ng in the
ccurrences
verything that looks empty:
^ - XOR
nd false otherwise.
Project Description
Convert Engineering Stress Strain to Useful Simulation Inputs for all
of the data I have in one go
make copies of folders and files based upon some sequence (DOE
purpose) Completed 1/5/2021
Solving Sudoku automatically
Solving Rubik's cube of different size and level automatically
check if URL is valid or not based on a string input
webscraping a material database and see if it's possible
relook at the text browser project
create a webpage that allows others to upload file directly to my
google drive
Monte Carlo Simulation Tool
evaluation of integration error in drifts
Individual Project Tracking Sheet
Item # Task list Java or Python
Total
Comments Week Identifier
Minutes
11/18/2020 9:28 11/18/2020 13:15 11/18/2020 14:37 11/18/2020 16:33 11/18/2020 21:06
12/13/2020 13:00 12/13/2020 18:23 12/13/2020 20:37 12/13/2020 21:57 12/13/2020 23:17
12/14/2020 11:13 12/14/2020 11:34 12/14/2020 12:51 12/14/2020 17:58 12/14/2020 20:04
12/15/2020 11:25 12/15/2020 13:15 12/15/2020 15:19 12/15/2020 17:06 12/15/2020 19:32
12/23/2020 12:54 12/23/2020 14:52 12/23/2020 20:13 12/23/2020 23:30 12/24/2020 0:26
12/24/2020 10:34 12/24/2020 12:19 12/24/2020 12:45 12/24/2020 18:16 12/24/2020 21:16
12/25/2020 12:06 12/25/2020 15:16 12/25/2020 15:53 12/25/2020 16:59 12/25/2020 21:00
12/26/2020 14:39 12/26/2020 18:42 12/26/2020 19:44 12/26/2020 20:02 12/27/2020 0:06
12/28/2020 9:25 12/28/2020 12:00 12/28/2020 12:31 12/28/2020 18:09 12/28/2020 19:52
1/4/2021 15:50 1/4/2021 20:02 1/4/2021 21:51 1/4/2021 22:19 1/4/2021 22:36
1/5/2021 12:02 1/5/2021 17:24 1/5/2021 22:48 1/6/2021 0:28
1/6/2021 10:27 1/6/2021 12:19 1/6/2021 15:19 1/6/2021 15:55
1/9/2021 12:15 1/9/2021 14:53 1/9/2021 15:06 1/9/2021 22:13 1/9/2021 22:30
1/10/2021 8:40 1/10/2021 9:03 1/10/2021 12:18 1/10/2021 15:13 1/10/2021 21:48
1/11/2021 10:38 1/11/2021 12:51 1/11/2021 13:59 1/11/2021 14:40 1/11/2021 16:11
1/14/2021 12:52 1/14/2021 13:52 1/14/2021 14:19 1/14/2021 14:56 1/14/2021 15:24
1/15/2021 18:28 1/15/2021 23:16 1/16/2021 0:31 1/16/2021 1:05
1/16/2021 22:45 1/16/2021 23:26
1/18/2021 13:18 1/18/2021 14:25 1/18/2021 15:19 1/18/2021 20:16 1/18/2021 21:39
1/19/2021 11:10 1/19/2021 12:06 1/19/2021 13:06 1/19/2021 15:34 1/19/2021 17:35
1/21/2021 13:34 1/21/2021 13:53
2/9/2021 11:32 2/9/2021 12:12
2/11/2021 17:25 2/11/2021 20:20 2/11/2021 20:46 2/11/2021 21:18 2/11/2021 21:54
2/13/2021 11:00 2/13/2021 11:49
2/16/2021 14:13 2/16/2021 15:11
3/3/2021 17:08 3/3/2021 18:18 3/3/2021 20:50 3/3/2021 21:41
4/4/2021 14:14 4/4/2021 16:15
4/6/2021 22:45 4/7/2021 0:05
4/10/2021 22:52 4/11/2021 0:15
4/14/2021 1:03 4/14/2021 1:22 4/14/2021 23:27 4/14/2021 23:56
4/15/2021 22:13 4/16/2021 0:17
4/18/2021 18:31 4/18/2021 21:27
5/9/2021 20:36 5/9/2021 21:05
6/20/2021 22:20 6/20/2021 23:43 6/21/2021 20:34 6/22/2021 0:13
6/28/2021 19:26 6/28/2021 21:18 6/28/2021 22:00 6/28/2021 22:52
7/6/2021 23:38 7/7/2021 1:50
7/7/2021 21:21 7/8/2021 0:24
7/9/2021 0:23 7/9/2021 1:34
7/24/2021 21:56 7/25/2021 1:48
8/26/2021 22:15 8/27/2021 0:40
8/27/2021 22:13 8/28/2021 2:02
8/28/2021 11:20 8/28/2021 13:26 8/28/2021 15:11 8/28/2021 16:15 8/28/2021 21:37
8/29/2021 0:24 8/29/2021 1:51 8/29/2021 16:24 8/29/2021 20:08 8/29/2021 20:37
8/30/2021 10:28 8/30/2021 15:59 8/30/2021 21:06 8/30/2021 22:37
8/31/2021 8:15 8/31/2021 16:00
9/1/2021 22:01 9/1/2021 22:52 9/1/2021 23:44 9/2/2021 0:29
9/9/2021 22:53 9/10/2021 1:52
9/13/2021 11:04 9/13/2021 16:44 9/13/2021 23:41 9/14/2021 0:35
9/14/2021 12:08 9/14/2021 16:58
9/15/2021 11:04 9/15/2021 17:04 9/15/2021 23:40 9/16/2021 1:00
9/16/2021 11:51 9/16/2021 17:01
10/19/2021 11:12 10/19/2021 16:00
10/20/2021 10:09 10/20/2021 13:15
11/11/2021 19:41 11/11/2021 20:11
Time End Time Start Time End Time Start Time End
10/20/2020 17:01
10/27/2020 18:38
10/31/2020 16:18
11/2/2020 18:42
11/13/2020 14:42
11/15/2020 23:58
11/16/2020 22:56
11/19/2020 1:37
11/22/2020 2:49
11/22/2020 20:48 11/22/2020 23:21 11/23/2020 0:37
12/7/2020 21:55
12/8/2020 18:04 12/8/2020 21:07 12/8/2020 23:49
12/9/2020 21:47
12/14/2020 1:51
12/15/2020 0:12
12/16/2020 0:16
12/24/2020 2:04
12/24/2020 23:20
1/5/2021 0:06
1/9/2021 22:49
1/14/2021 17:33 1/14/2021 19:53 1/14/2021 22:25 1/14/2021 23:57 1/15/2021 1:19
1/18/2021 23:57
1/19/2021 19:54
2/11/2021 22:18
8/28/2021 23:21
8/29/2021 22:29 8/29/2021 22:37 8/29/2021 23:28
Time Start Time End Time Start Time End Time Start
Time End Time Start Time End Time Start Time End
Time Start Time End
Individual Project Tracking Sheet
Item # Task list Java or Python
Total
Comments Week Identifier
Minutes