Skip to main content

Featured post

5 Super SEO Blogger Tools

In this post, I have explained top blogging tools that need to be considered by every blogger. These tools help you write better SEO friendly blog posts.



1). Headline Analyzer The best tool is the EMV Headline Analyzer. When you enter the headline it analyzes it and gives you EMV ranking. When you get '50' and above it performs better SEO.

2). Headline Length Checker The usual headline length is 50 to 60 characters. Beyond that, the headline will get truncated and looks ugly for search engine users. The tool SERP Snippet Optimization Tool useful to know how it appears in the search results.

3). Free Submission to Search Engines The tool Ping-O-Matic is a nice free submission tool. After your blog post, you can submit your feed to Ping-O-Matic. It submits to search engines freely.

4). Spell and Grammar Check Another free tool is Grammarly, this tool checks your spelling and grammar mistakes. So that you can avoid small mistakes.

5). Keyword AnalyzerWordstream Keyword analyzer i…

Python user defined functions real examples

In Python, user-defined functions real use is you can use in scripts You can avoid repeated work. These are very different from C/C++/JAVA. I will give you syntax and example for your quick reference and how to start learning quickly.
udf in python

Python Syntax for User defined function(UDF)

def function_name(list of parameters): 
"docstring" 
statement(s) 
return(parameter)       

  Explanation of each keyword 

  1. The keyword def symbolizes the start of the function header.
  2. A function name to uniquely identify it. Function naming follows the similar rules that are used for writing identifiers
  3. List of parameters also called as a list of arguments through which value is passed to the function. The list of parameters is optional.
  4. A colon (:) to mark the end of function header.
  5. Optional documentation string (docstring) is used to describe the purpose of the function, which is slightly similar to python documentation using comment.
  6. Python statements that perform the intended task for which the user-defined function is made. It is mandatory to maintain the indentation level while writing python statements in the function definition.
  7. In the end, an optional return statement is used to return a value (result) from the function. This statement can contain an optional parameter to return the computed result back to the function call. If there is no parameter in the statement or the return statement is not mentioned at the end of function definition then the function returns the None object.
The above example is a good one. You can start learning Python UDF quickly.

Python Vs Other Languages
Python in analytics
Python is one of the most popular languages in data analytics. There are many other languages that have an option to create UDFs. Even in SQL of any database, you can easily create user-defined functions.

Advantages of Python UDF

  • User-defined functions help to decompose a large program into small segments which make the program easy to understand, maintain and debug.
  • If repeated code occurs in a program. The function can be used to include those codes and execute when needed by calling that function.
  • Programmers working on the large project can divide the workload by making different functions.
References

One practical advice

It is always a good idea to name user-defined functions according to the task they perform.

Also Read

Comments

Most Viewed

Tokenization story you need Vault based Vs Vault-less

The term tokenization refers to create a numeric or alphanumeric number in place of the original card number. It is difficult for hackers to get original card numbers.

Vault-Tokenization is a concept a Vault server create a new Token for each transaction when Customer uses Credit or Debit Card at Merchant outlets 
Let us see an example,  data analysis. Here, card numbers masked with other junk characters for security purpose.

Popular Tokenization ServersThere are two kinds of servers currently popular for implementing tokenization.
Vault-based Vault-less Video Presentation on Tokenization
Vault-based server The term vault based means both card number and token will be stored in a Table usually Teradata tables. During increasing volume of transactions, the handling of Table is a big challenge.
Every time during tokenization it stores a record for each card and its token. When you used a card multiple times, each time it generates multiple tokens. It is a fundamental concept.
So the challe…