<jupyter_start><jupyter_text>Question 1<jupyter_code>Write code snippets in python to perform the following tasks :
•	Print your current working directory
•	Create a new directory on your desktop named: “Text Mining and NLP”
•	Make “Text Mining and NLP” your current working directory<jupyter_output><empty_output><jupyter_text>import osPrint your current working directoryprint os.getcwd()Create a new directory on your desktop named: “Text Mining and NLP”os.mkdir("C:\Users\ysaxe2\Desktop\Text Mining and NLP")Make “Text Mining and NLP” your current working directoryos.chdir("C:\Users\ysaxe2\Desktop\Text Mining and NLP")<jupyter_code>### Question 2<jupyter_output><empty_output><jupyter_text>Write code snippets in python to perform the following tasks:•	Create a text file named “Greetings.txt” and write “Welcome to Text Mining and Natural Language Processing”•	Move this file to the folder “Text Mining and NLP” which you created in ques 1•	Rename this file to “Welcome.txt”<jupyter_code>#Create a text file named “Greetings.txt” and write “Welcome to Text Mining and Natural Language Processing”
file=open("C:\Users\ysaxe2\Desktop\NLP Edureka\Solutions\Greetings.txt",'w+')
file.write("Welcome to Text Mining and Natural Language Processing")
file.close()

#Move this file to the folder “Text Mining and NLP” which you created in ques 1
import shutil
shutil.move("C:\Users\ysaxe2\Desktop\NLP Edureka\Solutions\Greetings.txt", "C:\Users\ysaxe2\Desktop\Text Mining and NLP\Greetings.txt")

#Rename this file to “Welcome.txt”
import os
os.rename("C:\Users\ysaxe2\Desktop\Text Mining and NLP\Greetings.txt","C:\Users\ysaxe2\Desktop\Text Mining and NLP\Welcome.txt")<jupyter_output><empty_output><jupyter_text>Question 3<jupyter_code>You are given a docx file named “NLP.docx”. Perform the following tasks:
•	Use OS module to open the file and perform the following tasks:
•	How many paragraphs are there in the file?
•	For each paragraph, print the number of words it contains
•	Read the content from “Greeting.txt” file which you created in question number 2 and make that content the first paragraph in “NLP.docx” file<jupyter_output><empty_output><jupyter_text>import docx Use OS module to open the filedocument = docx.Document('NLP.docx')How many paragraphs are there in the file?print len(document.paragraphs)For each paragraph, print the number of words it containsfor i,each in enumerate(document.paragraphs,1):    words=each.text.split(" ")    print each.text    print "Paragraph ",i," contains ",len(words),"words."     Read the content from “Welcome.txt” file which you created in question number 2....and make that content the first paragraph in “NLP.docx” filecontent=open('C:\Users\ysaxe2\Desktop\Text Mining and NLP\Welcome.txt','r+').read()new_paragraph = document.add_paragraph(content)document = docx.Document('NLP.docx')first_para=document.paragraphs[0]first_para.insert_paragraph_before(content)Save changes to Document document.save('NLP.docx')<jupyter_code>### Question 4<jupyter_output><empty_output><jupyter_text>You are given a csv file named “EmployeeDetails.csv”. Perform the following tasks:•	Use pandas module to read the csv file•	Split the name as first name and last name and make two separate columns             •	Delete “Name” Column •	Increment the “Salary” Column by 10% of the existing value and save changes in same column only   •	Save changes to a new file named “Employee_Data.csv”<jupyter_code>#Use pandas module to read the csv file
import pandas as pd
df=pd.read_csv('EmployeeDetails.csv')
#Split the name as first name and last name and make two separate columns 
df['First Name']=map(lambda x : x.split(" ")[0],df['Name '])
df['Last Name']=map(lambda x : x.split(" ")[1],df['Name '])
#Delete “Name” Column
del df['Name ']
#Increment the “Salary” Column by 10% of the existing value and save changes in same column only 
df['Salary']=map(lambda x : x*1.1,df['Salary'])
#Save changes to a new file named “Employee_Data.csv”
df.to_csv('Employee_Data.csv',index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10014836795252226, 'fraction_numerical': 0.006429277942631058, 'mean_word_length': 5.83277027027027, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '621189', 'license': 'MIT', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1227, 'n_words': 456, 'path': '1-Introduction/assignment2_edureka_sol.ipynb', 'repo_name': 'tuhinssam/NLP', 'size': '4044'}