Ravindra Bagale · Data Scienceसर्व coursesया course चे lessonsशोधाEnglish

Data Science · मराठी आवृत्ती · Python basics

P1.1 Data Science साठी Python का वापरतात?

By Ravindra Bagale

हे का शिकायचं?

Data काम म्हणजे files वाचणं, आकडे साफ करणं आणि charts बनवणं. Python हे तिन्ही छोट्या, वाचायला सोप्या code ने करतो. Banks, hospitals, दुकानं आणि delivery companies सगळे Python वापरतात.

हे काय आहे?

Python ही free programming भाषा आहे. आपण साध्या English सारख्या शब्दांत instructions लिहितो. Python interpreter नावाचा program त्या एक-एक line वाचून चालवतो. Library म्हणजे तयार code (pandas, NumPy), Jupyter Notebook म्हणजे browser मधलं page जिथे छोट्या cells मध्ये code चालवतो.

कसं करायचं?

Step 1. तुम्ही code ची line लिहा.

Step 2. Run दाबा (Jupyter मध्ये Shift+Enter).

Step 3. Interpreter ती line वाचतो आणि काम करतो.

Step 4. Result code च्या खाली दिसतो.

1. You type code2. Python interpreter reads it3. It runs one line at a time4. Result is printed
वरून खाली वाचा: code पासून result पर्यंतचा प्रवास

Python आणि इतर भाषा: तुलना

या भाषा शिकायची गरज नाही. Python किती सोपा वाचायला आहे ते दाखवण्यासाठी ही table आहे.

भाषाCode
Pythonprint("Hello")
JavaSystem.out.println("Hello"); (inside a class and a main method)
JavaScriptconsole.log("Hello");
Gofmt.Println("Hello") (inside package main and func main)

उदाहरणं: copy करा आणि चालवा

उदाहरण A: सगळ्यात छोटा Python program

हा code चालवा:

print("Hello from Python")

तुम्हाला दिसणारा output:

Hello from Python

याचा अर्थ: print() कंसातलं जे असेल ते दाखवतो. Text नेहमी quotes मध्ये लिहा.

उदाहरण B: Python calculator सारखा वापरा

हा code चालवा:

print(3 * 12.50)

तुम्हाला दिसणारा output:

37.5

याचा अर्थ: * म्हणजे गुणाकार. 37.5 म्हणजे £37.50. रोजच्या झटपट हिशोबासाठी असा Python वापरता येतो.