Showing posts with label Learning. Show all posts
Showing posts with label Learning. Show all posts

Wednesday, 14 November 2018

Let's Learn - Password-less setup for Git


Every time when committing changes to github repository, we need to provide github credential which is annoying. Github provides solution for this repeatable activity by setting up password-less communication between github repo and local repository via SSH keys.


1. Generate SSH Keys -
ssh-keygen -t rsa -C your_registered_email@example.com



2, View and Copy the public key



3. Add the public keys to github repository.
a. Open your repo --> Setting



b. Click on Deploy --> Add Keys


c. Paste copied public key and save


SSH Setup has been completed, Now test it by pushing some changes to repository.

4. Making changes to README.md file


5. Stage and Commit


6. Last, push changes to remote.


Changes have been pushed to Remote repository without asking user credentials. You can use the same public key to all your git repository.

Hope you have enjoyed the post, will meet again with new stuff.....till then.......Happy Learning !!!..................



Like the below page to get update  
Facebook Page      Facebook Group      Twitter Feed      Google+ Feed      Telegram Group     


Tuesday, 13 November 2018

Let's Learn - Git Basics #2


Continuing from last post Let's Learn - Git Basics #1 where we have created the github account and a new repository. It is always a good practice to put all your code/work in one place so create a folder named something easily recognizable such as "gitCode" (in my case I have used "Git"). This will ensure that all your git code will be there for easy access.

Configuration:
Before starting to work, we will add configuration settings on our "Git" folder by executing below commands.

=
Check Configuration:
After setting up, you can view what your configurations look like by below commands -
=
=
=

Command to check Status:
To check the status of our work, GIT provides a command as below, It's very helpful while working with git - 
=
=
Working with new Repository:
a. We have already created a new repository on github named "git-learn", let's create a local repo as well.
==


b. After creating a local repository, we need to make it git repository by command "git init", this will create a hidden folder inside "git-learn" which holds all the changes done in local repository
==

c. Out git repository is ready, now let's make the first change inside it by creating a README.md file which holds the information about this repository. This is a markdown file which is used for repository documentation
==

d. After making this change, let's check the local git repo status.
==

"git status" command will display the current status of repo, Here, we can see README.md file under untracked files category (we will discuss about different type of status type later).
Untracked Files: Files about which git is not aware, as this is a new file. To push this file to remote git, we need to stage this file.

e. For staging this file, run the command as below -
==

After staging the file, we check the repo status which tells that there is a new file which has been staged to commit. But this changes hasn't been committed for push to remote repo.

f. Committing the changes is very easy and it's advisable to provide a proper comment while commit which help you in future while reviewing all the commits done on remote repo
==

g. Changes are committed, now we are good to push these changes to remote repository. But before that, as this is a new local repository, we need to tell this to which remote git repository it should commit to, Hence run the below add command, you have to run this command once per repository, so from next commit, no need to run this command unless you want to change the remote repo url.

When you push the local changes to remote, it will ask your github credentials as below (push will ask github credential every time which can be annoying and can be avoidable by setting up ssh keys with github account)
==

h. After entering github credentials, it will start pushing the data to remote git repo. 


i. When push is complete, we can check the current repo status as above.
j. You can view all the commits have been done on repository by "git log" command
==


In next post, we will see the type of changes done in git repository and how to setup password-less git repository.
Till then, Keep Loving this Blog .......... Happy Learning...........



Like the below page to get update  
Facebook Page      Facebook Group      Twitter Feed      Google+ Feed      Telegram Group     


Monday, 12 November 2018

Let's Learn - Git Basics #1


Github, Another awesome creation by Linux Father - Linus Torvalds. Github is an open source Code repository management service/tool which provides you ease of parallel development without any hassle and care to maintain the code versions and merge issue. If you want to know, read and learn here - https://lab.github.com

Git Basics #1:

1. If you are new to Github, Create your account first on https://github.com
 

2. After creating your account, create a new repository by clicking on  "New" button

3. Fill the Repository Name and descriptions as below -

You can initialize the README file and add the other files but I haven't done it as will add them from command line.

4. Once your repository has been created, Github shows you these commands to replicate the repo and use them in your local system.


If Repository is new -

If this is existing repository (which is not as we have created it just now)


Installing Git Client

1. Go to git-scm link - https://git-scm.com/downloads and choose Git client for your OS.
2. For windows users, It's pretty straight forward to download the client and install it as regular software.
3. For Linux users, It's little tricky as different linux distro have different software management or repository and command line to install it. But Git also take care of all the commands for most popular linux distro on this link - https://git-scm.com/download/linux

Once, You have the Git Client and Git Account Setup, We can start with the basics with #2 post.






Like the below page to get update  
Facebook Page      Facebook Group      Twitter Feed      Google+ Feed      Telegram Group     


Tuesday, 16 January 2018

Python Pickle - to save your efforts


This tutorial is for Python beginners who just started getting dirty in Python :-) Lots of time when we are working on some data set and completed lots of cleaning and pre-processing steps, It's advisable from GURUs to save that intermediary dataset to avoid the re-do all the steps if something unexpected happen with Python, Jupyter notebook or your system for rebooted without your permission, weird though :-/



So, let's learn how to save any dataset or variable with Pickle library -

To Import:


To Save: 


To Read:





Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Thursday, 28 September 2017

Mathematics in Markdown


From Wiki - 
Markdown is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML and many other formats using a tool by the same name.[8] Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor(extensions - *.markdown , *.md ). website
Best thing of markdown files is you can convert the same into html without any issue. 



I've introduced with Markdown files when I have started to put my code on GitHub (https://github.com/atulsingh0). Started with little up n downs but after I've fallen for it, Its easy to write ReadMe or Math Equations files in markdown with little help.

In this tutorial, I have focused on Mathematics part only, for writing math formulas, Markdown is using LaTeX symbols for Greek letters, Brackets, Sign operator and lots of other symbols.

I have consolidated few of them and will add more,
Hoping, you will find it useful -  Direct Link

==








Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Wednesday, 31 May 2017

Remove ctrl-M character from all files within Directory #iLoveScripting


Continuing our journey on #iLoveScripting,..............
This script will do the same task as "clnM.sh" but this will accept Directory Path as an input rather than the filename. It will iterate through each file within given directory and remove all Ctrl-M characters.


If you are unable to see the Script, Please find it here - LINK







Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Tuesday, 30 May 2017

Remove ctrl-M character from file #iLoveScripting


This is my first post under #iLoveScripting which will have lots of shell script which are helping me in my day to day task and sharing here for all guys for easing their work as well.

 The very magical script, which I have use, is "clnM.sh". This script is remove the ctrl-M characters (^M) from your windows file.

Usage:  clnM.sh <FILE>


If you are unable to see the Script, Please find it here - LINK




Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Saturday, 14 January 2017

Learning Numpy #2

Thursday, 12 January 2017

Learning Numpy #1


Numpy is a python library used for numerical calculations and this is better performant than pure python. In this notebook, I have shared some basics of Numpy and will share more in next few posts. I hope you find these useful.





Click Here for Next Tutorial ~

Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Wednesday, 11 January 2017

My Learning Path for Machine Learning


I am a Python Lover guy so my way includes lots of Python points. If you dont know the basics of this wonderful language, start it from HERE else you can follow the links which I am going to share.

Learning ML is not only studying ML algorithms, it includes Basic Algebra, Statistics, Algorithms, Programming and lot more. But no need to afraid as such :-) we need to start from somewhere.....

This is my github repo, you can fork it and follow me with these 2 links --

Fork Fork
Follow - Follow @atulsingh0
I am still updating this list and welcome you to update this as well.



Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Friday, 6 January 2017

10 minutes with pandas library

Thursday, 5 January 2017

Learning Pandas #5 - read & write data from file

Wednesday, 4 January 2017

Learning Pandas #4 - Hierarchical Indexing

Sunday, 1 January 2017

Learning Pandas #3 - Working on Summary & MissingData

Saturday, 31 December 2016

Learning Pandas - DataFrame #2

Friday, 30 December 2016

Learning Pandas - Series #1

Wednesday, 28 December 2016

Learning Graphlab - SFrame #2

In last post Learning Graphlab - SFrame #1, we have learn basics of SFrame, like how to create, add or delete the columns in SFrame. In this post, we will revise it once again and learn some advance features of SFrame. Have a good learnng !!!

You can view the Jupyter Notebook for the same HERE




Wednesday, 30 November 2016

Learning Graphlab - SFrame #1


Hoping you guys went through the last post (Lnk -> Getting Started with Graphlab), In this post we will do some handson SFrame datatype of Graphlab which is same as dataframe of pandas python library.

i. Reading the CSV file
==
rdCSV

ii. save DataSet 
==

iii. load DataSet
==


iv. Check Total Rows and Columns
==
rowNum

v. Check Columns data type and Name
==
colTypes

vi. Add new column
==
addCol

vii. Delete column
==

viii. Rename column
==
renameCol

ix. Column Swapping (location)
==






Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/

Sunday, 27 November 2016

Getting Started with Graphlab - A Python library for Machine Learning


Before Starting with Graphlab, We have to configure our system with some basic tools such as Python, Jupyter Notebook etc. You can find 'How-To' on this link - http://bit.ly/2gvuG95

What is GraphLab ??
GraphLab Create is a Python library, backed by a C++ engine, for quickly building large-scale, high-performance data products. Some key features of GraphLab Create are:
  • Analyze terabyte scale data at interactive speeds, on your desktop.
  • A Single platform for tabular data, graphs, text, and images.
  • State of the art machine learning algorithms including deep learning, boosted trees, and factorization machines.
  • Run the same code on your laptop or in a distributed system, using a Hadoop Yarn or EC2 cluster.
  • Focus on tasks or machine learning with the flexible API.
  • Visualize data for exploration and production monitoring.
After the installation of Graphlab library we can use it as any python library.

Use Jupyter Notebook for starter, Open a Python notebook in Jupyter Notebook and execute below commands to see graphlab working -

 a. Importing Graphlab - 

=





b. Reading CSV file
This method will parse the input file and convert it into a SFrame variable

==


c. Getting Started with SFrame 

i. View content of SFrame variable sf

==


ii. View Head lines (top lines) 

==



ii. View Tail lines (last lines)
 
==







Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/