09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2

ETL with Python (Structured Data)

for i in range(len(columns)):

print columns[i]

print "Not index choose the exact column names

seperated by coma"

cols = sys.stdin.readline().strip()

out.write("columns=" + cols + "\n")

cursor.close()

connection.close()

out.write("source end"+"\n")

print "Enter the Data Source Type:"

print "1. MySql"

print "2. Text"

print "3. Exit"

if(int(data1) == 2):

print "path of text file:"

path = sys.stdin.readline().strip()

file = open(path)

count = 0

for line in file:

print line

count = count + 1

if count > 3:

break

file.close()

out.write("source begin"+"\n"+"type=text\n")

out.write("path=" + path + "\n")

print "enter delimeter:"

dlm = sys.stdin.readline().strip()

out.write("dlm=" + dlm + "\n")

print "enter column indexes seperated by comma:"

30

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!