Featured post

Hadoop fs (File System) Commands List

Hadoop HDSF File system commands given in this post. These are useful for your projects and interviews. 1. Syntax to Use HDFS File System Commands. Hadoop fs -cmd <args> cmd is a specific command and arg is the variable name.  2. List of Top File System Commands. cat  Hadoop fs –cat FILE [FILE …]  Displays the files' content. For reading compressed files.  chgrp  Hadoop fs –chgrp [-R] GROUP PATH [PATH …]  Changes the group association for files and directories. The – R option applies the change recursively.  The user must be the files' owner or a superuser.  chmod  Hadoop fs –chmod [-R] MODE[,MODE …] PATH [PATH …]  Changes the permissions of files and directories. Like, its Unix equivalent, MODE can be a 3-digit octal mode, or {augo}+/-{rwxX}. The -R option applies the change recursively. The user must be the files' owner or a superuser.  chown  Hadoop fs –chown [-R] [OWNER][:[GROUP]] PATH [PATH…]  Changes the ownership of files and directories. The –R option applies

10 Text Cleaning Technics You need in Python

Python is popular for Text analytics. The data present in the Text has unwanted hidden data. While working on analytics, you need to remove these. The List of unwanted things in data. Removing HTML tags Tokenization Removing unnecessary tokens and stopwords Handling contractions Correcting spelling errors Stemming Lemmatization Tagging Chunking Parsing The First Steps in Text Analytics of Python Data is the prime source for analytics projects. The Data is then fed to intelligent systems such as Machine Learning and Deep Learning. 1. Removing HTML tags The unstructured text contains a lot of noise, especially if you use techniques like web scraping or screen scraping to retrieve data from web pages, blogs, and online repositories. HTML tags, JavaScript, and Iframe tags typically don't add much value to understanding and analyzing text. Our purpose is we need to remove HTML tags and other noise. 2. Tokenization Tokens are independent and minimal textual components that have some defi

Python: Day of Week How to Calculate

Day of the week you can find in two ways. One is from Calendar, and another one is from a function. Here, I have given my ideas on a better method. Also, the result you can get in a tuple. You might also like Attitude is Everything That Changes Your Life. Day of Week and Day_Name Monday 0 Tuesday 1 Wednesday 2 Thursday 3 Friday 4 Saturday 5 Sunday 6 1. Python Logic to get Day of Week from Calendar from datetime import datetime import calendar dt = dn = dt.weekday() print ("Today is day number: {0}".format(dn)) print ("Today is a {0}".format(calendar.day_name[dn])) Here, the print uses string.format method to print output. Check out  the best example to use this method . Below is the output from the above logic The result from the first logic Instead of directly using DateTime, you can write a function - that creates a tuple with Day of week and Day name. 2. Python Logic to get Day and Day_name from a user-defined function from datetime import

Python: How to Swap Variable values without Intermediary

In Python, you can swap values without defining the intermediary variab les. This is possible with a tuple. I have shared a good example of how to do this. How to Swap Variable in Python. You can swap values for two variables using a tuple. The prime purpose of a tuple is you can hold multiple values. In this example, those are a and b. Here the tuple accepts two values. When you supply those, it swaps values and gives an output when you print them. def swap(a, b):  return b,a  Example-1 to call the tuple. i = "Hello world" j = "This is ApplyBigAnalytics"  i, j = swap(i, j)  print(i)  print(j)  Example-2 to call the tuple. i = 1  j = 2  i, j = swap(i,j)  print(i)  print(j) The Result is: This is ApplyBigAnalytics  Hello world  2  1 Keep Reading The Real Purpose of Underscore in Python 

Python placeholder '_' Top Ideas to Use it Perfectly

In Python, you can call the underscore ( _ ) operator placeholder.  The prime purpose is you can mask the variable that you don't use in a function. Python placeholder  Purpose of Placeholder The purpose is you can mask a few variables. This makes your code is readable. So in the future, you can replace placeholders with variable names you want. How to Use Placeholder in a Function I have explained in three steps how to use placeholder correctly. Code to create a Function Logic to use placeholder Logic to use two placeholders 1. Code to create a Function. def function_that_returns_multiple_values(x):        return x*2, x*3, x+1        for i in range(0,5):             square, cube, added_one = function_that_returns_multiple_values(i)             print(square, cube) In the above logic, in print, it returns only two variables. Therefore you can mask the third variable with an underscore.  Thus your code looks beautiful. 2. Logic to use Placeholder def function_that_returns_multiple_

13 Tricky Kubernetes Os Interview Questions

The tricky interview questions will simplify your job search - the listed questions are in the order of basic to midlevel skills.  Kubernetes is an operating system built to work on Linux distributions for the sole purpose of Kubernetes Cluster. Kubernetes Questions 13 Tricky Kubernetes Interview Questions. These interview questions help you to recap before the interviews. Also, you can use this knowledge for your projects. 1. What is Kubernetes? Kubernetes is Os (operating system) on the cloud, which oversees the cloud-native containerized apps. It is an orchestrator, which takes care of cloud apps - updates, rollback, scale-up, scale down, maintenance, etc. 2. What are Cloud-native apps? These apps run on the cloud, which means on any cloud - private, public. They also run in an on-premise datacenter. The right answer is- applications designed and written in such a way that scale up or scale down as demand rises or fallen. 3. What are Containerized apps? Containers, which have images

5 Python File Modes to Deal with Big data

Python file modes, the purpose is to open, read, write the files. There are occasions you need to deal with data, which is present in the files. You need to give correct file-modes to handle the files in Python. Python file open modes File Open Modes in Python. filename = input('Enter a filename : ') f1 = open(filename, 'mode') Python File mode w  To open the file for writing, you need w mode. The beauty of this is If the file does not exist, it creates one. This mode's purpose is to write the file. If you try to read, you will get an error. Python File mode w+ To Open the file for Reading and Writing, you need w+ mode. For instance, you used w+, you have tried to read the file - after writing, it displays blank. The reason is after writing cursor position will point at the end of the file. Python File mode a It appends the records at the end of the existing file. The file must exist to use this mode. Python File mode r To open a file in read-only mode. If the file

5 Python Interpreter Tricky Questions

Python is an interpreter, a nd its main task is to execute the program. When it first encounters the .py module, it converts it to Bytecode, which is portable. And it is a one-time job. How Interpreter different from Compiler. It is Byte code, which is in the form of '00001111000111' -  zeros and ones.  Internal Mechanism; Internally, the  Python interpreter  converts source-code to byte-code when you first execute it. So to run Python-program, you need an interpreter installed on your machine. You May Also Like   Bytecode Vs. Machine Code Execution flow of Interpreter For your program, you need the below two: Interpreter Libraries Interpreter. The process of the interpreter is BlackBox to the programmer. The interpreter creates a .pyc module, which will be an input to PVM, and to use in next time processing. The PVM (Python Virtual Machine) is just like JVM in Java, a run-time environment, which executes Byte-code and gives you output. Here are  4 Python Oops Concepts. Librari