PYTHON PANDAS loc[] & iloc[]

.loc[] .loc[]/ is used to select/access a subset from a DataFrame using row/column names. Syntax: <DataFrameObject>.loc[<start row>: <end row>,<start column>:<end column>] To access a row: <DF object>.loc[<row label>,:] To access multiple rows: <DF object>.loc[<start row>:<end row>,:] To access selective columns: <DF object>.loc[:,<start column>:<end column>] To access range of columns and rows: <DF object>.loc[<start row>:<end row>,<start … Continue reading PYTHON PANDAS loc[] & iloc[]

ZFILL IN PYTHON

The zfill() method adds zeros (0) at the beginning of the string, until it reaches the specific length. If the value of the len parameter is less than the length of the string, no filling is done. Syntax: string.zfill(len) parameter: len A number specifying the position of the element you want to remove. EXAMPLES: a=”hello” … Continue reading ZFILL IN PYTHON

PYTHON BUILD-IN FUNCTIONS

LEN() Len function take an iterable object and returns the numbers of items in an object. Example: >>items = [1,2,3,4] >>print(len(items)) Output :4 ZIP() Zip function can take nth iterable objects and return a zip object which is an iterator of tuples. Example: >>ids=[1,2,3] >>names=[‘a’,’b’,’c’] zipobj=zip(ids,names) print(list(z)) Output: [(1,’a’),(2,’b’)'(3,’c’)] ORD() Ord function return a number … Continue reading PYTHON BUILD-IN FUNCTIONS

SORTING ALGORITHMS IN PYTHON

INSERTION SORT Insertion sort algorithm places an unsorted element at its suitable place in each iteration and it’s suitable place in each iteration and it’s similar as we sort cards in our hand in a card game. It is efficient for smaller data sets, but very inefficient for larger lists. COMPLEXITY OF INSERTION SORT Time … Continue reading SORTING ALGORITHMS IN PYTHON

TERMINOLOGIES

These are some of the terminologies you needed to understand the machine learning. model A mathematical representation of a real world process; a predictive model forecasts a future outcome based on past behaviors. training The process of creating a model from the training data. The data is fed into the training algorithm, which learn a … Continue reading TERMINOLOGIES

Design a site like this with WordPress.com
Get started