Tutorial by Examples: and

Number of unique elements in a series: In [1]: id_numbers = pd.Series([111, 112, 112, 114, 115, 118, 114, 118, 112]) In [2]: id_numbers.nunique() Out[2]: 5 Get unique elements in a series: In [3]: id_numbers.unique() Out[3]: array([111, 112, 114, 115, 118], dtype=int64) In [4]: df = pd.Da...
You need to set who you are *before* creating any commit. That will allow commits to have the right author name and email associated to them. It has nothing to do with authentication when pushing to a remote repository (e.g. when pushing to a remote repository using your GitHub, BitBucket, or Gi...
You can get list of available commands by following way: >>> python manage.py help If you don't understand any command or looking for optional arguments then you can use -h argument like this >>> python manage.py command_name -h Here command_name will be your desire command...
CSV(Comma Separated Values) is a simple file format used to store tabular data, such as a spreadsheet. This is a minimal example of how to write & read data in Python. Writing data to a CSV file: import csv data = [["Ravi", "9", "550"], ["Joe", "8...
Example for continue for i in [series] do command 1 command 2 if (condition) # Condition to jump over command 3 continue # skip to the next value in "series" fi command 3 done Example for break for i in [series] do command 4 if (condi...
if true do "Will be seen since condition is true." end if false do "Won't be seen since condition is false." else "Will be seen. end unless false do "Will be seen." end unless true do "Won't be seen." else ...
The HBox and VBox layouts are very similar, both lay out their children in a single line. Common characteristics If an HBox or a VBox have a border and/or padding set, then the contents will be layed out within those insets. They lay out each managed child regardless of the child's visible proper...
sp_who2 This procedure can be used to find information on current SQL server sessions. Since it is a procedure, it's often helpful to store the results into a temporary table or table variable so one can order, filter, and transform the results as needed. The below can be used for a queryable v...
To create a mixin use the @mixin directive. @mixin default-box ($color, $borderColor) { color: $color; border: 1px solid $borderColor; clear: both; display: block; margin: 5px 0; padding: 5px 10px; } You can specify a list of arguments inside a parenthesis followin...
string nullString = null; string emptyString = ""; string whitespaceString = " "; string tabString = "\t"; string newlineString = "\n"; string nonEmptyString = "abc123"; bool result; result = String.IsNullOrEmpty(nullString); ...
Create generic class instance: var stringRunnable = new Runnable<string>(); Run generic function: function runSafe<T extends Runnable<U>, U>(runnable: T); // Specify the generic types: runSafe<Runnable<string>, string>(stringRunnable); // Let typescript figu...
Using the mmap module allows the user to randomly access locations in a file by mapping the file into memory. This is an alternative to using normal file operations. import mmap with open('filename.ext', 'r') as fd: # 0: map the whole file mm = mmap.mmap(fd.fileno(), 0) # print ...
If you are familiar with jQuery and Sizzle syntax, d3 selections should not be much different. d3 mimics the W3C Selectors API to make interacting with elements easier. For a basic example, to select all <p> and add a change to each of them: d3.selectAll('p') .attr('class','textClass') ...
The lubridate package provides convenient functions to format date and datetime objects from character strings. The functions are permutations of LetterElement to parseBase R equivalentyyear%y, %Ym (with y and d)month%m, %b, %h, %Bdday%d, %ehhour%H, %I%pm (with h and s)minute%Msseconds%S e.g. ymd(...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
import pandas as pd import numpy as np np.random.seed(0) rng = pd.date_range('2015-02-24', periods=10, freq='T') df = pd.DataFrame({'Val' : np.random.randn(len(rng))}, index=rng) print (df) Val 2015-02-24 00:00:00 1.764052 2015-02-24 00:01:00 0.400157 2015-02...
Each pair in the dictionary is an instance of KeyValuePair with the same type parameters as the Dictionary. When you loop through the dictionary with For Each, each iteration will give you one of the Key-Value Pairs stored in the dictionary. For Each kvp As KeyValuePair(Of String, String) In curren...
Get width and height: var width = $('#target-element').width(); var height = $('#target-element').height(); Set width and height: $('#target-element').width(50); $('#target-element').height(100);
Get width and height: var width = $('#target-element').innerWidth(); var height = $('#target-element').innerHeight(); Set width and height: $('#target-element').innerWidth(50); $('#target-element').innerHeight(100);
Get width and height (excluding margin): var width = $('#target-element').outerWidth(); var height = $('#target-element').outerHeight(); Get width and height (including margin): var width = $('#target-element').outerWidth(true); var height = $('#target-element').outerHeight(true); Set widt...

Page 30 of 153