├── .DS_Store ├── DC References ├── .DS_Store ├── 1. Python Basics │ ├── ch1_slides.pdf │ ├── ch2_slides.pdf │ ├── ch3_slides.pdf │ └── ch4_slides.pdf ├── 2. Python_Intermediate │ └── intermediate_python_ch1_slides.pdf └── 4. Python_DataScience Toolbox-1 │ └── ch1_slides.pdf ├── DataSets ├── Ambulance.txt ├── Excel_Sample.xlsx ├── PythonAdvanced.ipynb ├── Salaries.csv ├── capm_dem.dat ├── capm_dem.txt ├── cars.csv ├── compustat.csv ├── crsp.output ├── data1.csv ├── data2.csv ├── data3.csv ├── data4.csv ├── roedata.csv ├── roedatawrite.csv ├── roedatawrite2.csv ├── roemissing.csv ├── tb_deaths_100.csv ├── tb_existing_100.csv ├── tb_new_100.csv ├── u.data ├── u.item ├── u.user └── wc_file.txt ├── Exercises ├── Conditional statements assignment.pdf ├── Dictionary assignment.pdf ├── Functions.pdf ├── List assignment.pdf ├── Loops assignment (1).pdf ├── OOPS Assignment.pdf ├── Pandas Practice Questions and Solution.ipynb ├── Python Basic- Interview │ ├── cypher.py │ ├── fibonacci.py │ ├── string_exercise.py │ └── wc.py ├── Python Basics │ ├── Python Basic Assignment │ │ ├── Exercise_01_-_Python_Basics.ipynb │ │ ├── Exercise_02_-_Python_Basics.ipynb │ │ ├── Exercise_03_-_Python_Basics.ipynb │ │ ├── Exercise_04_-_Python_Basics.ipynb │ │ └── Exercise_05_-_Python Basics.ipynb │ └── Python Basics Assignments(Solved) │ │ ├── Exercise_01_-_Python_Basics.ipynb │ │ ├── Exercise_01_-_Python_Basics_solved.ipynb │ │ ├── Exercise_02_-_Python_Basics.ipynb │ │ ├── Exercise_03_-_Python_Basics.ipynb │ │ ├── Exercise_04_-_Python_Basics.ipynb │ │ └── Exercise_05_-_Python Basics.ipynb ├── String assignment.pdf └── Tuple and set assignment.pdf ├── Exploratory Data Analysis Using Python- Part-1.ipynb ├── Installation-Guide.docx ├── Python Advanced.ipynb ├── PythonAdvanced_Part-2.ipynb ├── PythonBasics.ipynb ├── Python_basics_practice_exercise.md ├── README.md ├── Revision CLasses ├── .ipynb_checkpoints │ └── Python Revision- Class-1-checkpoint.ipynb └── Python Revision- Class-1.ipynb ├── Statistical Inference and Hypothesis Testing.ipynb ├── Tutorial Reference Slides ├── ConditionalStatements.pptx ├── ControlStatements.pptx ├── PYTHON- OBJECT ORIENTED PROGRAMMING.pdf ├── Python Sets.pptx ├── lists in python.pptx └── python-tuple.pptx ├── python-cheatsheet ├── Bokeh-Python DS Cheat Sheet.pdf ├── Data Wrangling-Pandas_Cheat_Sheet.pdf ├── Jupyter Notebook-Python DS Cheat Sheet.pdf ├── Keras-Python DS Cheat Sheet.pdf ├── Matplotlib-Python DS Cheat Sheet.pdf ├── Numpy Basics-Python DS Cheat Sheet.pdf ├── Pandas Basic-Python DS Cheat Sheet.pdf ├── Pandas Cheat Sheet Data Wrangling in Python.png ├── PySpark - RDD Basics.pdf ├── PySpark-SQL Baiscs -Python DS Cheat Sheet.pdf ├── Python Basics-Python DS Cheat Sheet.pdf ├── PythonForDataScience.pdf ├── Python_Tutorial__1621540958.pdf ├── SciPy - Linear Algebra-Python DS Cheat Sheet.pdf ├── Scikit-Learn-Python DS Cheat Sheet.pdf ├── Seaborn-Python DS Cheat Sheet.pdf ├── attachment_Pandas_Cheat_Sheet.pdf ├── attachment_Pandas_DataFrame_Notes.pdf ├── attachment_Python_Matplotlib_Cheat_Sheet.pdf ├── attachment_Quotes_about_Python.pdf ├── attachment_Suggested_Reads_on_Stats_and_Maths_for_Data_Science.pdf └── attachment_python_cheat_sheet.pdf ├── python_class_tutorial.py ├── python_samples ├── .DS_Store ├── 06 - Dictionaries-C.ipynb ├── 1.1 String updated .ipynb ├── 1.2.1 - Tuples.ipynb ├── ConditionalStatements_updated.ipynb ├── Encapsulation In Python.ipynb ├── Encapsulation.ipynb ├── Functions.ipynb ├── Inheritance and Method Overriding in Python.ipynb ├── Lambda function, Map Reduce and Filter.ipynb ├── Loops_updated.ipynb ├── Operators in Python updated.ipynb ├── Polymorphism Practice.ipynb ├── Polymorphism.ipynb ├── Python Basic commands.ipynb ├── Python Basics.ipynb ├── Python List - 101.ipynb ├── Sets.ipynb └── assignment │ ├── Conditional statements assignment.pdf │ ├── Dictionary assignment.pdf │ ├── Functions.pdf │ ├── List assignment.pdf │ ├── Loops assignment (1).pdf │ ├── OOPS Assignment.pdf │ ├── String assignment.pdf │ └── Tuple and set assignment.pdf ├── sample.py └── sample_tweets.txt /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/.DS_Store -------------------------------------------------------------------------------- /DC References/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/.DS_Store -------------------------------------------------------------------------------- /DC References/1. Python Basics/ch1_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/1. Python Basics/ch1_slides.pdf -------------------------------------------------------------------------------- /DC References/1. Python Basics/ch2_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/1. Python Basics/ch2_slides.pdf -------------------------------------------------------------------------------- /DC References/1. Python Basics/ch3_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/1. Python Basics/ch3_slides.pdf -------------------------------------------------------------------------------- /DC References/1. Python Basics/ch4_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/1. Python Basics/ch4_slides.pdf -------------------------------------------------------------------------------- /DC References/2. Python_Intermediate/intermediate_python_ch1_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/2. Python_Intermediate/intermediate_python_ch1_slides.pdf -------------------------------------------------------------------------------- /DC References/4. Python_DataScience Toolbox-1/ch1_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DC References/4. Python_DataScience Toolbox-1/ch1_slides.pdf -------------------------------------------------------------------------------- /DataSets/Ambulance.txt: -------------------------------------------------------------------------------- 1 | Ambulance is here to 2 | take us home to help us 3 | Ambulance is ALWAYS here to help us always 4 | ambulance is really necessary 5 | please give way to ambulance as and when required -------------------------------------------------------------------------------- /DataSets/Excel_Sample.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DataSets/Excel_Sample.xlsx -------------------------------------------------------------------------------- /DataSets/capm_dem.dat: -------------------------------------------------------------------------------- 1 | 00195710 880211 -0.012605 0.003871 2 | 00195710 880212 -0.008511 0.007406 3 | 00195710 880216 0.008584 0.001411 4 | 00195710 880217 -0.004255 0.002414 5 | 00195710 880218 0 0.002845 6 | 00195710 880219 0.008547 0.004753 7 | 00195710 880222 0.012712 0.006375 8 | 00195710 880223 -0.008368 0.001864 9 | 00195710 880224 -0.008439 0.004237 10 | 00195710 880225 -0.004255 0.005164 11 | 00195710 880226 -0.008547 0.001747 12 | 00195710 880229 0.012931 0.011278 13 | 00195710 880301 -0.008511 0.001305 14 | 00195710 880302 0.008584 0.005652 15 | 00195710 880303 -0.017021 0.002895 16 | 00195710 880304 0.004329 0.004586 17 | 00195710 880307 -0.017241 0.00374 18 | 00195710 880308 -0.008772 0.006258 19 | 00195710 880309 0.00885 0.008291 20 | 00195710 880310 -0.008772 -0.004363 21 | 00195710 880311 -0.00885 0.000796 22 | 00195710 880314 0.013393 0.002721 23 | 00195710 880315 0.008811 0.001341 24 | 00195710 880316 0.004367 0.004319 25 | 00195710 880317 0.008696 0.005612 26 | 00195710 880318 -0.008621 0.003249 27 | 00195710 880321 -0.004348 -0.004265 28 | 00195710 880322 -0.008734 0.00276 29 | 00195710 880323 -0.004405 0.003259 30 | 00195710 880324 -0.017699 -0.006748 31 | 00195710 880325 -0.011712 -0.006075 32 | 00195710 880328 -0.013825 -0.006236 33 | 00195710 880329 0.004673 0.006625 34 | 00195710 880330 -0.013953 -0.001708 35 | 00195710 880331 0.018868 0.007634 36 | 00195710 880404 -0.013889 -0.005177 37 | 00195710 880405 0.00939 0.002342 38 | 00195710 880406 0.046512 0.007862 39 | 00195710 880407 -0.004444 0.003649 40 | 00195710 880408 0.004464 0.008284 41 | 00195710 880411 -0.008889 0.000455 42 | 00195710 880412 0.008969 0.004093 43 | 00195710 880413 -0.004444 0.000273 44 | 00195710 880414 -0.049107 -0.017634 45 | 00195710 880415 0 -0.001734 46 | 00195710 880418 -0.00939 0.002671 47 | 00195710 880419 0.004739 0.004033 48 | 00195710 880420 0 -0.004894 49 | 00195710 880421 0.004717 -0.000031 50 | 00195710 880422 0.018779 0.003857 51 | 00195710 880425 0.004608 0.002482 52 | 00195710 880426 -0.018349 0.004963 53 | 00195710 880427 -0.004673 0.002056 54 | 00195710 880428 -0.00939 0.001157 55 | 00195710 880429 0.004739 0.003796 56 | 00195710 880502 0 -0.001114 57 | 00195710 880503 0.018868 0.002655 58 | 00195710 880504 -0.023148 -0.000176 59 | 00195710 880505 -0.009479 -0.001624 60 | 00195710 880506 -0.004785 0.000376 61 | 00195710 880509 0.014423 -0.005489 62 | 00195710 880510 0.028436 0.000986 63 | 00195710 880511 -0.009217 -0.012381 64 | 00195710 880512 0.018605 0.002235 65 | 00195710 880513 -0.004566 0.005115 66 | 00195710 880516 0 0.000834 67 | 00195710 880517 -0.027523 -0.001624 68 | 00195710 880518 -0.018868 -0.010956 69 | 00195710 880519 0.024038 -0.001865 70 | 00195710 880520 0.004695 0.003239 71 | 00195710 880523 -0.014019 -0.003542 72 | 00195710 880524 0.004739 0.0017 73 | 00195710 880525 -0.014151 0.001598 74 | 00282410 880225 -0.00495 0.005164 75 | 00282410 880226 -0.007463 0.001747 76 | 00282410 880229 0.042607 0.011278 77 | 00282410 880301 -0.004808 0.001305 78 | 00282410 880302 -0.002415 0.005652 79 | 00282410 880303 0.002421 0.002895 80 | 00282410 880304 -0.002415 0.004586 81 | 00282410 880307 -0.002421 0.00374 82 | 00282410 880308 -0.024272 0.006258 83 | 00282410 880309 0 0.008291 84 | 00282410 880310 -0.0199 -0.004363 85 | 00282410 880311 -0.025381 0.000796 86 | 00282410 880314 0.010417 0.002721 87 | 00282410 880315 0.002577 0.001341 88 | 00282410 880316 -0.002571 0.004319 89 | 00282410 880317 0.018041 0.005612 90 | 00282410 880318 0.017722 0.003249 91 | 00282410 880321 -0.00995 -0.004265 92 | 00282410 880322 -0.01005 0.00276 93 | 00282410 880323 -0.017766 0.003259 94 | 00282410 880324 -0.010336 -0.006748 95 | 00282410 880325 -0.031332 -0.006075 96 | 00282410 880328 0.002695 -0.006236 97 | 00282410 880329 0.010753 0.006625 98 | 00282410 880330 -0.00266 -0.001708 99 | 00282410 880331 0 0.007634 100 | 00282410 880404 -0.013333 -0.005177 101 | 00282410 880405 0.013514 0.002342 102 | 00282410 880406 0.016 0.007862 103 | 00282410 880407 0.026247 0.003649 104 | 00282410 880408 0.033248 0.008284 105 | 00282410 880411 -0.001485 0.000455 106 | 00282410 880412 0.004988 0.004093 107 | 00282410 880413 -0.002481 0.000273 108 | 00282410 880414 -0.039801 -0.017634 109 | 00282410 880415 -0.010363 -0.001734 110 | 00282410 880418 -0.005236 0.002671 111 | 00282410 880419 -0.021053 0.004033 112 | 00282410 880420 -0.013441 -0.004894 113 | 00282410 880421 -0.013624 -0.000031 114 | 00282410 880422 0.022099 0.003857 115 | 00282410 880425 0.024324 0.002482 116 | 00282410 880426 0.01847 0.004963 117 | 00282410 880427 -0.023316 0.002056 118 | 00282410 880428 -0.013263 0.001157 119 | 00282410 880429 -0.018817 0.003796 120 | 00282410 880502 0.013699 -0.001114 121 | 00282410 880503 -0.005405 0.002655 122 | 00282410 880504 -0.008152 -0.000176 123 | 00282410 880505 -0.010959 -0.001624 124 | 00282410 880506 -0.019391 0.000376 125 | 00282410 880509 0.008475 -0.005489 126 | 00282410 880510 -0.014006 0.000986 127 | 00282410 880511 -0.019886 -0.012381 128 | 00282410 880512 -0.002899 0.002235 129 | 00282410 880513 0.017442 0.005115 130 | 00282410 880516 0.028571 0.000834 131 | 00282410 880517 -0.011111 -0.001624 132 | 00282410 880518 -0.019663 -0.010956 133 | 00282410 880519 -0.002865 -0.001865 134 | 00282410 880520 0.005747 0.003239 135 | 00282410 880523 -0.014286 -0.003542 136 | 00282410 880524 0.014493 0.0017 137 | 00282410 880525 0.008571 0.001598 138 | 00282410 880526 0.031161 0.003151 139 | 00282410 880527 -0.008242 -0.000359 140 | 00282410 880531 0.027701 0.006501 141 | 00790310 880225 -0.020408 0.005164 142 | 00790310 880226 -0.010417 0.001747 143 | 00790310 880229 0.010526 0.011278 144 | 00790310 880301 -0.020833 0.001305 145 | 00790310 880302 0.053191 0.005652 146 | 00790310 880303 0 0.002895 147 | 00790310 880304 -0.020202 0.004586 148 | 00790310 880307 0.041237 0.00374 149 | 00790310 880308 0.039604 0.006258 150 | 00790310 880309 0.009524 0.008291 151 | 00790310 880310 -0.04717 -0.004363 152 | 00790310 880311 -0.009901 0.000796 153 | 00790310 880314 0 0.002721 154 | 00790310 880315 0.01 0.001341 155 | 00790310 880316 -0.029703 0.004319 156 | 00790310 880317 0.010204 0.005612 157 | 00790310 880318 0.010101 0.003249 158 | 00790310 880321 -0.03 -0.004265 159 | 00790310 880322 0.030928 0.00276 160 | 00790310 880323 -0.02 0.003259 161 | 00790310 880324 -0.030612 -0.006748 162 | 00790310 880325 -0.052632 -0.006075 163 | 00790310 880328 -0.011111 -0.006236 164 | 00790310 880329 0.022472 0.006625 165 | 00790310 880330 -0.032967 -0.001708 166 | 00790310 880331 0 0.007634 167 | 00790310 880404 0.011364 -0.005177 168 | 00790310 880405 0.022472 0.002342 169 | 00790310 880406 0.054945 0.007862 170 | 00790310 880407 0.041667 0.003649 171 | 00790310 880408 0.07 0.008284 172 | 00790310 880411 0.028037 0.000455 173 | 00790310 880412 -0.009091 0.004093 174 | 00790310 880413 -0.018349 0.000273 175 | 00790310 880414 -0.056075 -0.017634 176 | 00790310 880415 -0.009901 -0.001734 177 | 00790310 880418 0.03 0.002671 178 | 00790310 880419 -0.019417 0.004033 179 | 00790310 880420 -0.009901 -0.004894 180 | 00790310 880421 0 -0.000031 181 | 00790310 880422 0.05 0.003857 182 | 00790310 880425 0.028571 0.002482 183 | 00790310 880426 0.018519 0.004963 184 | 00790310 880427 0.036364 0.002056 185 | 00790310 880428 0.017544 0.001157 186 | 00790310 880429 -0.008621 0.003796 187 | 00790310 880502 0 -0.001114 188 | 00790310 880503 -0.008696 0.002655 189 | 00790310 880504 0.017544 -0.000176 190 | 00790310 880505 0 -0.001624 191 | 00790310 880506 -0.017241 0.000376 192 | 00790310 880509 -0.04386 -0.005489 193 | 00790310 880510 0.018349 0.000986 194 | 00790310 880511 0 -0.012381 195 | 00790310 880512 0.045045 0.002235 196 | 00790310 880513 0.034483 0.005115 197 | 00790310 880516 0 0.000834 198 | 00790310 880517 -0.016667 -0.001624 199 | 00790310 880518 -0.033898 -0.010956 200 | 00790310 880519 0.04386 -0.001865 201 | 00790310 880520 -0.016807 0.003239 202 | 00790310 880523 -0.034188 -0.003542 203 | 00790310 880524 0.026549 0.0017 204 | 00790310 880525 -0.008621 0.001598 205 | 00790310 880526 -0.008696 0.003151 206 | 00790310 880527 0 -0.000359 207 | 00790310 880531 0.052632 0.006501 208 | 00811710 880225 -0.036458 0.005164 209 | 00811710 880226 0.010811 0.001747 210 | 00811710 880229 0.018717 0.011278 211 | 00811710 880301 0 0.001305 212 | 00811710 880302 0.002625 0.005652 213 | 00811710 880303 0.005236 0.002895 214 | 00811710 880304 -0.007813 0.004586 215 | 00811710 880307 0.002625 0.00374 216 | 00811710 880308 0 0.006258 217 | 00811710 880309 -0.010471 0.008291 218 | 00811710 880310 -0.010582 -0.004363 219 | 00811710 880311 -0.002674 0.000796 220 | 00811710 880314 -0.008043 0.002721 221 | 00811710 880315 0 0.001341 222 | 00811710 880316 0 0.004319 223 | 00811710 880317 -0.010811 0.005612 224 | 00811710 880318 -0.008197 0.003249 225 | 00811710 880321 -0.002755 -0.004265 226 | 00811710 880322 -0.005525 0.00276 227 | 00811710 880323 -0.005556 0.003259 228 | 00811710 880324 -0.013966 -0.006748 229 | 00811710 880325 -0.002833 -0.006075 230 | 00811710 880328 -0.017045 -0.006236 231 | 00811710 880329 0.00578 0.006625 232 | 00811710 880330 -0.014368 -0.001708 233 | 00811710 880331 0.023324 0.007634 234 | 00811710 880404 -0.008547 -0.005177 235 | 00811710 880405 0.031609 0.002342 236 | 00811710 880406 -0.011142 0.007862 237 | 00811710 880407 -0.016901 0.003649 238 | 00811710 880408 0.014327 0.008284 239 | 00811710 880411 0.00565 0.000455 240 | 00811710 880412 0.016854 0.004093 241 | 00811710 880413 0.002762 0.000273 242 | 00811710 880414 -0.044077 -0.017634 243 | 00811710 880415 -0.020173 -0.001734 244 | 00811710 880418 0.002941 0.002671 245 | 00811710 880419 -0.005865 0.004033 246 | 00811710 880420 0.00295 -0.004894 247 | 00811710 880421 0.002941 -0.000031 248 | 00811710 880422 0.002933 0.003857 249 | 00811710 880425 0.013216 0.002482 250 | 00811710 880426 0.017595 0.004963 251 | 00811710 880427 -0.014409 0.002056 252 | 00811710 880428 0.008772 0.001157 253 | 00811710 880429 -0.026087 0.003796 254 | 00811710 880502 -0.008929 -0.001114 255 | 00811710 880503 -0.006006 0.002655 256 | 00811710 880504 0.003021 -0.000176 257 | 00811710 880505 -0.003012 -0.001624 258 | 00811710 880506 -0.018127 0.000376 259 | 00811710 880509 -0.003077 -0.005489 260 | 00811710 880510 -0.006173 0.000986 261 | 00811710 880511 -0.012422 -0.012381 262 | 00811710 880512 0.009434 0.002235 263 | 00811710 880513 0.012461 0.005115 264 | 00811710 880516 0.003077 0.000834 265 | 00811710 880517 -0.018405 -0.001624 266 | 00811710 880518 0.003125 -0.010956 267 | 00811710 880519 0.006231 -0.001865 268 | 00811710 880520 0.012384 0.003239 269 | 00811710 880523 -0.003058 -0.003542 270 | 00811710 880524 0.02454 0.0017 271 | 00811710 880525 0.008982 0.001598 272 | 00811710 880526 0 0.003151 273 | 00811710 880527 0.002967 -0.000359 274 | 00811710 880531 0.038462 0.006501 275 | -------------------------------------------------------------------------------- /DataSets/capm_dem.txt: -------------------------------------------------------------------------------- 1 | 00195710 880211 -0.012605 0.003871 2 | 00195710 880212 -0.008511 0.007406 3 | 00195710 880216 0.008584 0.001411 4 | 00195710 880217 -0.004255 0.002414 5 | 00195710 880218 0 0.002845 6 | 00195710 880219 0.008547 0.004753 7 | 00195710 880222 0.012712 0.006375 8 | 00195710 880223 -0.008368 0.001864 9 | 00195710 880224 -0.008439 0.004237 10 | 00195710 880225 -0.004255 0.005164 11 | 00195710 880226 -0.008547 0.001747 12 | 00195710 880229 0.012931 0.011278 13 | 00195710 880301 -0.008511 0.001305 14 | 00195710 880302 0.008584 0.005652 15 | 00195710 880303 -0.017021 0.002895 16 | 00195710 880304 0.004329 0.004586 17 | 00195710 880307 -0.017241 0.00374 18 | 00195710 880308 -0.008772 0.006258 19 | 00195710 880309 0.00885 0.008291 20 | 00195710 880310 -0.008772 -0.004363 21 | 00195710 880311 -0.00885 0.000796 22 | 00195710 880314 0.013393 0.002721 23 | 00195710 880315 0.008811 0.001341 24 | 00195710 880316 0.004367 0.004319 25 | 00195710 880317 0.008696 0.005612 26 | 00195710 880318 -0.008621 0.003249 27 | 00195710 880321 -0.004348 -0.004265 28 | 00195710 880322 -0.008734 0.00276 29 | 00195710 880323 -0.004405 0.003259 30 | 00195710 880324 -0.017699 -0.006748 31 | 00195710 880325 -0.011712 -0.006075 32 | 00195710 880328 -0.013825 -0.006236 33 | 00195710 880329 0.004673 0.006625 34 | 00195710 880330 -0.013953 -0.001708 35 | 00195710 880331 0.018868 0.007634 36 | 00195710 880404 -0.013889 -0.005177 37 | 00195710 880405 0.00939 0.002342 38 | 00195710 880406 0.046512 0.007862 39 | 00195710 880407 -0.004444 0.003649 40 | 00195710 880408 0.004464 0.008284 41 | 00195710 880411 -0.008889 0.000455 42 | 00195710 880412 0.008969 0.004093 43 | 00195710 880413 -0.004444 0.000273 44 | 00195710 880414 -0.049107 -0.017634 45 | 00195710 880415 0 -0.001734 46 | 00195710 880418 -0.00939 0.002671 47 | 00195710 880419 0.004739 0.004033 48 | 00195710 880420 0 -0.004894 49 | 00195710 880421 0.004717 -0.000031 50 | 00195710 880422 0.018779 0.003857 51 | 00195710 880425 0.004608 0.002482 52 | 00195710 880426 -0.018349 0.004963 53 | 00195710 880427 -0.004673 0.002056 54 | 00195710 880428 -0.00939 0.001157 55 | 00195710 880429 0.004739 0.003796 56 | 00195710 880502 0 -0.001114 57 | 00195710 880503 0.018868 0.002655 58 | 00195710 880504 -0.023148 -0.000176 59 | 00195710 880505 -0.009479 -0.001624 60 | 00195710 880506 -0.004785 0.000376 61 | 00195710 880509 0.014423 -0.005489 62 | 00195710 880510 0.028436 0.000986 63 | 00195710 880511 -0.009217 -0.012381 64 | 00195710 880512 0.018605 0.002235 65 | 00195710 880513 -0.004566 0.005115 66 | 00195710 880516 0 0.000834 67 | 00195710 880517 -0.027523 -0.001624 68 | 00195710 880518 -0.018868 -0.010956 69 | 00195710 880519 0.024038 -0.001865 70 | 00195710 880520 0.004695 0.003239 71 | 00195710 880523 -0.014019 -0.003542 72 | 00195710 880524 0.004739 0.0017 73 | 00195710 880525 -0.014151 0.001598 74 | 00282410 880225 -0.00495 0.005164 75 | 00282410 880226 -0.007463 0.001747 76 | 00282410 880229 0.042607 0.011278 77 | 00282410 880301 -0.004808 0.001305 78 | 00282410 880302 -0.002415 0.005652 79 | 00282410 880303 0.002421 0.002895 80 | 00282410 880304 -0.002415 0.004586 81 | 00282410 880307 -0.002421 0.00374 82 | 00282410 880308 -0.024272 0.006258 83 | 00282410 880309 0 0.008291 84 | 00282410 880310 -0.0199 -0.004363 85 | 00282410 880311 -0.025381 0.000796 86 | 00282410 880314 0.010417 0.002721 87 | 00282410 880315 0.002577 0.001341 88 | 00282410 880316 -0.002571 0.004319 89 | 00282410 880317 0.018041 0.005612 90 | 00282410 880318 0.017722 0.003249 91 | 00282410 880321 -0.00995 -0.004265 92 | 00282410 880322 -0.01005 0.00276 93 | 00282410 880323 -0.017766 0.003259 94 | 00282410 880324 -0.010336 -0.006748 95 | 00282410 880325 -0.031332 -0.006075 96 | 00282410 880328 0.002695 -0.006236 97 | 00282410 880329 0.010753 0.006625 98 | 00282410 880330 -0.00266 -0.001708 99 | 00282410 880331 0 0.007634 100 | 00282410 880404 -0.013333 -0.005177 101 | 00282410 880405 0.013514 0.002342 102 | 00282410 880406 0.016 0.007862 103 | 00282410 880407 0.026247 0.003649 104 | 00282410 880408 0.033248 0.008284 105 | 00282410 880411 -0.001485 0.000455 106 | 00282410 880412 0.004988 0.004093 107 | 00282410 880413 -0.002481 0.000273 108 | 00282410 880414 -0.039801 -0.017634 109 | 00282410 880415 -0.010363 -0.001734 110 | 00282410 880418 -0.005236 0.002671 111 | 00282410 880419 -0.021053 0.004033 112 | 00282410 880420 -0.013441 -0.004894 113 | 00282410 880421 -0.013624 -0.000031 114 | 00282410 880422 0.022099 0.003857 115 | 00282410 880425 0.024324 0.002482 116 | 00282410 880426 0.01847 0.004963 117 | 00282410 880427 -0.023316 0.002056 118 | 00282410 880428 -0.013263 0.001157 119 | 00282410 880429 -0.018817 0.003796 120 | 00282410 880502 0.013699 -0.001114 121 | 00282410 880503 -0.005405 0.002655 122 | 00282410 880504 -0.008152 -0.000176 123 | 00282410 880505 -0.010959 -0.001624 124 | 00282410 880506 -0.019391 0.000376 125 | 00282410 880509 0.008475 -0.005489 126 | 00282410 880510 -0.014006 0.000986 127 | 00282410 880511 -0.019886 -0.012381 128 | 00282410 880512 -0.002899 0.002235 129 | 00282410 880513 0.017442 0.005115 130 | 00282410 880516 0.028571 0.000834 131 | 00282410 880517 -0.011111 -0.001624 132 | 00282410 880518 -0.019663 -0.010956 133 | 00282410 880519 -0.002865 -0.001865 134 | 00282410 880520 0.005747 0.003239 135 | 00282410 880523 -0.014286 -0.003542 136 | 00282410 880524 0.014493 0.0017 137 | 00282410 880525 0.008571 0.001598 138 | 00282410 880526 0.031161 0.003151 139 | 00282410 880527 -0.008242 -0.000359 140 | 00282410 880531 0.027701 0.006501 141 | 00790310 880225 -0.020408 0.005164 142 | 00790310 880226 -0.010417 0.001747 143 | 00790310 880229 0.010526 0.011278 144 | 00790310 880301 -0.020833 0.001305 145 | 00790310 880302 0.053191 0.005652 146 | 00790310 880303 0 0.002895 147 | 00790310 880304 -0.020202 0.004586 148 | 00790310 880307 0.041237 0.00374 149 | 00790310 880308 0.039604 0.006258 150 | 00790310 880309 0.009524 0.008291 151 | 00790310 880310 -0.04717 -0.004363 152 | 00790310 880311 -0.009901 0.000796 153 | 00790310 880314 0 0.002721 154 | 00790310 880315 0.01 0.001341 155 | 00790310 880316 -0.029703 0.004319 156 | 00790310 880317 0.010204 0.005612 157 | 00790310 880318 0.010101 0.003249 158 | 00790310 880321 -0.03 -0.004265 159 | 00790310 880322 0.030928 0.00276 160 | 00790310 880323 -0.02 0.003259 161 | 00790310 880324 -0.030612 -0.006748 162 | 00790310 880325 -0.052632 -0.006075 163 | 00790310 880328 -0.011111 -0.006236 164 | 00790310 880329 0.022472 0.006625 165 | 00790310 880330 -0.032967 -0.001708 166 | 00790310 880331 0 0.007634 167 | 00790310 880404 0.011364 -0.005177 168 | 00790310 880405 0.022472 0.002342 169 | 00790310 880406 0.054945 0.007862 170 | 00790310 880407 0.041667 0.003649 171 | 00790310 880408 0.07 0.008284 172 | 00790310 880411 0.028037 0.000455 173 | 00790310 880412 -0.009091 0.004093 174 | 00790310 880413 -0.018349 0.000273 175 | 00790310 880414 -0.056075 -0.017634 176 | 00790310 880415 -0.009901 -0.001734 177 | 00790310 880418 0.03 0.002671 178 | 00790310 880419 -0.019417 0.004033 179 | 00790310 880420 -0.009901 -0.004894 180 | 00790310 880421 0 -0.000031 181 | 00790310 880422 0.05 0.003857 182 | 00790310 880425 0.028571 0.002482 183 | 00790310 880426 0.018519 0.004963 184 | 00790310 880427 0.036364 0.002056 185 | 00790310 880428 0.017544 0.001157 186 | 00790310 880429 -0.008621 0.003796 187 | 00790310 880502 0 -0.001114 188 | 00790310 880503 -0.008696 0.002655 189 | 00790310 880504 0.017544 -0.000176 190 | 00790310 880505 0 -0.001624 191 | 00790310 880506 -0.017241 0.000376 192 | 00790310 880509 -0.04386 -0.005489 193 | 00790310 880510 0.018349 0.000986 194 | 00790310 880511 0 -0.012381 195 | 00790310 880512 0.045045 0.002235 196 | 00790310 880513 0.034483 0.005115 197 | 00790310 880516 0 0.000834 198 | 00790310 880517 -0.016667 -0.001624 199 | 00790310 880518 -0.033898 -0.010956 200 | 00790310 880519 0.04386 -0.001865 201 | 00790310 880520 -0.016807 0.003239 202 | 00790310 880523 -0.034188 -0.003542 203 | 00790310 880524 0.026549 0.0017 204 | 00790310 880525 -0.008621 0.001598 205 | 00790310 880526 -0.008696 0.003151 206 | 00790310 880527 0 -0.000359 207 | 00790310 880531 0.052632 0.006501 208 | 00811710 880225 -0.036458 0.005164 209 | 00811710 880226 0.010811 0.001747 210 | 00811710 880229 0.018717 0.011278 211 | 00811710 880301 0 0.001305 212 | 00811710 880302 0.002625 0.005652 213 | 00811710 880303 0.005236 0.002895 214 | 00811710 880304 -0.007813 0.004586 215 | 00811710 880307 0.002625 0.00374 216 | 00811710 880308 0 0.006258 217 | 00811710 880309 -0.010471 0.008291 218 | 00811710 880310 -0.010582 -0.004363 219 | 00811710 880311 -0.002674 0.000796 220 | 00811710 880314 -0.008043 0.002721 221 | 00811710 880315 0 0.001341 222 | 00811710 880316 0 0.004319 223 | 00811710 880317 -0.010811 0.005612 224 | 00811710 880318 -0.008197 0.003249 225 | 00811710 880321 -0.002755 -0.004265 226 | 00811710 880322 -0.005525 0.00276 227 | 00811710 880323 -0.005556 0.003259 228 | 00811710 880324 -0.013966 -0.006748 229 | 00811710 880325 -0.002833 -0.006075 230 | 00811710 880328 -0.017045 -0.006236 231 | 00811710 880329 0.00578 0.006625 232 | 00811710 880330 -0.014368 -0.001708 233 | 00811710 880331 0.023324 0.007634 234 | 00811710 880404 -0.008547 -0.005177 235 | 00811710 880405 0.031609 0.002342 236 | 00811710 880406 -0.011142 0.007862 237 | 00811710 880407 -0.016901 0.003649 238 | 00811710 880408 0.014327 0.008284 239 | 00811710 880411 0.00565 0.000455 240 | 00811710 880412 0.016854 0.004093 241 | 00811710 880413 0.002762 0.000273 242 | 00811710 880414 -0.044077 -0.017634 243 | 00811710 880415 -0.020173 -0.001734 244 | 00811710 880418 0.002941 0.002671 245 | 00811710 880419 -0.005865 0.004033 246 | 00811710 880420 0.00295 -0.004894 247 | 00811710 880421 0.002941 -0.000031 248 | 00811710 880422 0.002933 0.003857 249 | 00811710 880425 0.013216 0.002482 250 | 00811710 880426 0.017595 0.004963 251 | 00811710 880427 -0.014409 0.002056 252 | 00811710 880428 0.008772 0.001157 253 | 00811710 880429 -0.026087 0.003796 254 | 00811710 880502 -0.008929 -0.001114 255 | 00811710 880503 -0.006006 0.002655 256 | 00811710 880504 0.003021 -0.000176 257 | 00811710 880505 -0.003012 -0.001624 258 | 00811710 880506 -0.018127 0.000376 259 | 00811710 880509 -0.003077 -0.005489 260 | 00811710 880510 -0.006173 0.000986 261 | 00811710 880511 -0.012422 -0.012381 262 | 00811710 880512 0.009434 0.002235 263 | 00811710 880513 0.012461 0.005115 264 | 00811710 880516 0.003077 0.000834 265 | 00811710 880517 -0.018405 -0.001624 266 | 00811710 880518 0.003125 -0.010956 267 | 00811710 880519 0.006231 -0.001865 268 | 00811710 880520 0.012384 0.003239 269 | 00811710 880523 -0.003058 -0.003542 270 | 00811710 880524 0.02454 0.0017 271 | 00811710 880525 0.008982 0.001598 272 | 00811710 880526 0 0.003151 273 | 00811710 880527 0.002967 -0.000359 274 | 00811710 880531 0.038462 0.006501 275 | -------------------------------------------------------------------------------- /DataSets/data1.csv: -------------------------------------------------------------------------------- 1 | Industry Name,Number of firms,ROE 2 | Advertising,65,RP 3 | Aerospace/Defense,95,21.60% 4 | Air Transport,25, 5 | Apparel,,17.87% 6 | Auto & Truck,26,22.05% 7 | Auto Parts,75,17.54% 8 | Bank,-999,-18.60% 9 | -------------------------------------------------------------------------------- /DataSets/data2.csv: -------------------------------------------------------------------------------- 1 | ,Industry Name,Number of firms,ROE 2 | 0,Advertising,65.0,RP 3 | 1,Aerospace/Defense,95.0,21.60% 4 | 2,Air Transport,25.0, 5 | 3,Apparel,,17.87% 6 | 4,Auto & Truck,26.0,22.05% 7 | 5,Auto Parts,75.0,17.54% 8 | 6,Bank,-999.0,-18.60% 9 | -------------------------------------------------------------------------------- /DataSets/data3.csv: -------------------------------------------------------------------------------- 1 | Industry Name,Number of firms,ROE 2 | Advertising,65.0,RP 3 | Aerospace/Defense,95.0,21.60% 4 | Air Transport,25.0, 5 | Apparel,,17.87% 6 | Auto & Truck,26.0,22.05% 7 | Auto Parts,75.0,17.54% 8 | Bank,-999.0,-18.60% 9 | -------------------------------------------------------------------------------- /DataSets/data4.csv: -------------------------------------------------------------------------------- 1 | Industry Name,ROE 2 | Advertising,RP 3 | Aerospace/Defense,21.60% 4 | Air Transport, 5 | Apparel,17.87% 6 | Auto & Truck,22.05% 7 | Auto Parts,17.54% 8 | Bank,-18.60% 9 | -------------------------------------------------------------------------------- /DataSets/roedata.csv: -------------------------------------------------------------------------------- 1 | Industry Name,Number of firms,ROE 2 | Advertising,65,16.51% 3 | Aerospace/Defense,95,21.60% 4 | Air Transport,25,42.68% 5 | Apparel,70,17.87% 6 | Auto & Truck,26,22.05% 7 | Auto Parts,75,17.54% 8 | Bank,7,15.03% 9 | Banks (Regional),721,9.52% 10 | Beverage ,47,27.62% 11 | Beverage (Alcoholic),19,18.28% 12 | Biotechnology,349,6.77% 13 | Broadcasting,30,74.10% 14 | Brokerage & Investment Banking,49,9.25% 15 | Building Materials,37,6.78% 16 | Business & Consumer Services,179,12.48% 17 | Cable TV,16,26.62% 18 | Chemical (Basic),47,8.80% 19 | Chemical (Diversified),10,24.33% 20 | Chemical (Specialty),100,22.10% 21 | Coal & Related Energy,45,-14.66% 22 | Computer Services,129,39.46% 23 | Computer Software,273,21.53% 24 | Computers/Peripherals,66,24.55% 25 | Construction,18,3.62% 26 | Diversified,20,13.06% 27 | Educational Services,40,-0.13% 28 | Electrical Equipment,135,13.67% 29 | Electronics,191,7.98% 30 | Electronics (Consumer & Office),26,25.66% 31 | Engineering,56,7.61% 32 | Entertainment,85,17.45% 33 | Environmental & Waste Services,108,8.28% 34 | Farming/Agriculture,29,4.82% 35 | Financial Svcs.,76,15.50% 36 | Financial Svcs. (Non-bank & Insurance),17,6.45% 37 | Food Processing,97,15.94% 38 | Food Wholesalers,18,17.74% 39 | Furn/Home Furnishings,36,12.99% 40 | Healthcare Equipment,193,11.87% 41 | Healthcare Facilities,47,26.29% 42 | Healthcare Products,58,5.52% 43 | Healthcare Services,126,13.14% 44 | Heathcare Information and Technology,125,9.45% 45 | Heavy Construction,46,22.00% 46 | Homebuilding,32,32.64% 47 | Hotel/Gaming,89,4.50% 48 | Household Products,139,21.68% 49 | Information Services,71,22.24% 50 | Insurance (General),26,4.08% 51 | Insurance (Life),27,6.08% 52 | Insurance (Prop/Cas.),53,14.34% 53 | Internet software and services,330,11.75% 54 | Investment Co.,65,9.68% 55 | Machinery,141,15.70% 56 | Metals & Mining,134,6.26% 57 | Office Equipment & Services,30,19.42% 58 | Oil/Gas (Integrated),8,18.31% 59 | Oil/Gas (Production and Exploration),411,6.74% 60 | Oil/Gas Distribution,80,12.66% 61 | Oilfield Svcs/Equip.,163,13.18% 62 | Packaging & Container,24,15.61% 63 | Paper/Forest Products,21,15.98% 64 | Pharma & Drugs,138,19.71% 65 | Power,106,8.70% 66 | Precious Metals,166,-8.92% 67 | Publshing & Newspapers,52,7.05% 68 | R.E.I.T.,46,12.55% 69 | Railroad,10,19.85% 70 | Real Estate (Development),22,-4.29% 71 | Real Estate (General/Diversified),11,1.02% 72 | Real Estate (Operations & Services),47,19.84% 73 | Recreation,70,18.03% 74 | Reinsurance,3,6.05% 75 | Restaurant,84,27.46% 76 | Retail (Automotive),30,30.79% 77 | Retail (Building Supply),7,23.12% 78 | Retail (Distributors),87,12.92% 79 | Retail (General),21,17.68% 80 | Retail (Grocery and Food),21,10.91% 81 | Retail (Internet),47,18.36% 82 | Retail (Special Lines),137,17.29% 83 | Rubber& Tires,4,45.41% 84 | Semiconductor,104,13.14% 85 | Semiconductor Equip,51,-1.21% 86 | Shipbuilding & Marine,14,0.37% 87 | Shoe,14,24.27% 88 | Steel,37,-6.67% 89 | Telecom (Wireless),28,-15.63% 90 | Telecom. Equipment,131,15.67% 91 | Telecom. Services,82,5.78% 92 | Thrift,223,-79.47% 93 | Tobacco,12,214.71% 94 | Transportation,22,14.75% 95 | Trucking,28,16.01% 96 | Utility (General),20,7.34% 97 | Utility (Water),20,9.95% 98 | Total Market,7766,15.68% 99 | -------------------------------------------------------------------------------- /DataSets/roedatawrite.csv: -------------------------------------------------------------------------------- 1 | ,Industry Name,Number of firms,ROE 2 | 0,Advertising,65,16.51% 3 | 1,Aerospace/Defense,95,21.60% 4 | 2,Air Transport,25,42.68% 5 | 3,Apparel,70,17.87% 6 | 4,Auto & Truck,26,22.05% 7 | 5,Auto Parts,75,17.54% 8 | 6,Bank,7,15.03% 9 | 7,Banks (Regional),721,9.52% 10 | 8,Beverage ,47,27.62% 11 | 9,Beverage (Alcoholic),19,18.28% 12 | 10,Biotechnology,349,6.77% 13 | 11,Broadcasting,30,74.10% 14 | 12,Brokerage & Investment Banking,49,9.25% 15 | 13,Building Materials,37,6.78% 16 | 14,Business & Consumer Services,179,12.48% 17 | 15,Cable TV,16,26.62% 18 | 16,Chemical (Basic),47,8.80% 19 | 17,Chemical (Diversified),10,24.33% 20 | 18,Chemical (Specialty),100,22.10% 21 | 19,Coal & Related Energy,45,-14.66% 22 | 20,Computer Services,129,39.46% 23 | 21,Computer Software,273,21.53% 24 | 22,Computers/Peripherals,66,24.55% 25 | 23,Construction,18,3.62% 26 | 24,Diversified,20,13.06% 27 | 25,Educational Services,40,-0.13% 28 | 26,Electrical Equipment,135,13.67% 29 | 27,Electronics,191,7.98% 30 | 28,Electronics (Consumer & Office),26,25.66% 31 | 29,Engineering,56,7.61% 32 | 30,Entertainment,85,17.45% 33 | 31,Environmental & Waste Services,108,8.28% 34 | 32,Farming/Agriculture,29,4.82% 35 | 33,Financial Svcs.,76,15.50% 36 | 34,Financial Svcs. (Non-bank & Insurance),17,6.45% 37 | 35,Food Processing,97,15.94% 38 | 36,Food Wholesalers,18,17.74% 39 | 37,Furn/Home Furnishings,36,12.99% 40 | 38,Healthcare Equipment,193,11.87% 41 | 39,Healthcare Facilities,47,26.29% 42 | 40,Healthcare Products,58,5.52% 43 | 41,Healthcare Services,126,13.14% 44 | 42,Heathcare Information and Technology,125,9.45% 45 | 43,Heavy Construction,46,22.00% 46 | 44,Homebuilding,32,32.64% 47 | 45,Hotel/Gaming,89,4.50% 48 | 46,Household Products,139,21.68% 49 | 47,Information Services,71,22.24% 50 | 48,Insurance (General),26,4.08% 51 | 49,Insurance (Life),27,6.08% 52 | 50,Insurance (Prop/Cas.),53,14.34% 53 | 51,Internet software and services,330,11.75% 54 | 52,Investment Co.,65,9.68% 55 | 53,Machinery,141,15.70% 56 | 54,Metals & Mining,134,6.26% 57 | 55,Office Equipment & Services,30,19.42% 58 | 56,Oil/Gas (Integrated),8,18.31% 59 | 57,Oil/Gas (Production and Exploration),411,6.74% 60 | 58,Oil/Gas Distribution,80,12.66% 61 | 59,Oilfield Svcs/Equip.,163,13.18% 62 | 60,Packaging & Container,24,15.61% 63 | 61,Paper/Forest Products,21,15.98% 64 | 62,Pharma & Drugs,138,19.71% 65 | 63,Power,106,8.70% 66 | 64,Precious Metals,166,-8.92% 67 | 65,Publshing & Newspapers,52,7.05% 68 | 66,R.E.I.T.,46,12.55% 69 | 67,Railroad,10,19.85% 70 | 68,Real Estate (Development),22,-4.29% 71 | 69,Real Estate (General/Diversified),11,1.02% 72 | 70,Real Estate (Operations & Services),47,19.84% 73 | 71,Recreation,70,18.03% 74 | 72,Reinsurance,3,6.05% 75 | 73,Restaurant,84,27.46% 76 | 74,Retail (Automotive),30,30.79% 77 | 75,Retail (Building Supply),7,23.12% 78 | 76,Retail (Distributors),87,12.92% 79 | 77,Retail (General),21,17.68% 80 | 78,Retail (Grocery and Food),21,10.91% 81 | 79,Retail (Internet),47,18.36% 82 | 80,Retail (Special Lines),137,17.29% 83 | 81,Rubber& Tires,4,45.41% 84 | 82,Semiconductor,104,13.14% 85 | 83,Semiconductor Equip,51,-1.21% 86 | 84,Shipbuilding & Marine,14,0.37% 87 | 85,Shoe,14,24.27% 88 | 86,Steel,37,-6.67% 89 | 87,Telecom (Wireless),28,-15.63% 90 | 88,Telecom. Equipment,131,15.67% 91 | 89,Telecom. Services,82,5.78% 92 | 90,Thrift,223,-79.47% 93 | 91,Tobacco,12,214.71% 94 | 92,Transportation,22,14.75% 95 | 93,Trucking,28,16.01% 96 | 94,Utility (General),20,7.34% 97 | 95,Utility (Water),20,9.95% 98 | 96,Total Market,7766,15.68% 99 | -------------------------------------------------------------------------------- /DataSets/roedatawrite2.csv: -------------------------------------------------------------------------------- 1 | Industry Name,ROE 2 | Advertising,16.51% 3 | Aerospace/Defense,21.60% 4 | Air Transport,42.68% 5 | Apparel,17.87% 6 | Auto & Truck,22.05% 7 | Auto Parts,17.54% 8 | Bank,15.03% 9 | Banks (Regional),9.52% 10 | Beverage ,27.62% 11 | Beverage (Alcoholic),18.28% 12 | Biotechnology,6.77% 13 | Broadcasting,74.10% 14 | Brokerage & Investment Banking,9.25% 15 | Building Materials,6.78% 16 | Business & Consumer Services,12.48% 17 | Cable TV,26.62% 18 | Chemical (Basic),8.80% 19 | Chemical (Diversified),24.33% 20 | Chemical (Specialty),22.10% 21 | Coal & Related Energy,-14.66% 22 | Computer Services,39.46% 23 | Computer Software,21.53% 24 | Computers/Peripherals,24.55% 25 | Construction,3.62% 26 | Diversified,13.06% 27 | Educational Services,-0.13% 28 | Electrical Equipment,13.67% 29 | Electronics,7.98% 30 | Electronics (Consumer & Office),25.66% 31 | Engineering,7.61% 32 | Entertainment,17.45% 33 | Environmental & Waste Services,8.28% 34 | Farming/Agriculture,4.82% 35 | Financial Svcs.,15.50% 36 | Financial Svcs. (Non-bank & Insurance),6.45% 37 | Food Processing,15.94% 38 | Food Wholesalers,17.74% 39 | Furn/Home Furnishings,12.99% 40 | Healthcare Equipment,11.87% 41 | Healthcare Facilities,26.29% 42 | Healthcare Products,5.52% 43 | Healthcare Services,13.14% 44 | Heathcare Information and Technology,9.45% 45 | Heavy Construction,22.00% 46 | Homebuilding,32.64% 47 | Hotel/Gaming,4.50% 48 | Household Products,21.68% 49 | Information Services,22.24% 50 | Insurance (General),4.08% 51 | Insurance (Life),6.08% 52 | Insurance (Prop/Cas.),14.34% 53 | Internet software and services,11.75% 54 | Investment Co.,9.68% 55 | Machinery,15.70% 56 | Metals & Mining,6.26% 57 | Office Equipment & Services,19.42% 58 | Oil/Gas (Integrated),18.31% 59 | Oil/Gas (Production and Exploration),6.74% 60 | Oil/Gas Distribution,12.66% 61 | Oilfield Svcs/Equip.,13.18% 62 | Packaging & Container,15.61% 63 | Paper/Forest Products,15.98% 64 | Pharma & Drugs,19.71% 65 | Power,8.70% 66 | Precious Metals,-8.92% 67 | Publshing & Newspapers,7.05% 68 | R.E.I.T.,12.55% 69 | Railroad,19.85% 70 | Real Estate (Development),-4.29% 71 | Real Estate (General/Diversified),1.02% 72 | Real Estate (Operations & Services),19.84% 73 | Recreation,18.03% 74 | Reinsurance,6.05% 75 | Restaurant,27.46% 76 | Retail (Automotive),30.79% 77 | Retail (Building Supply),23.12% 78 | Retail (Distributors),12.92% 79 | Retail (General),17.68% 80 | Retail (Grocery and Food),10.91% 81 | Retail (Internet),18.36% 82 | Retail (Special Lines),17.29% 83 | Rubber& Tires,45.41% 84 | Semiconductor,13.14% 85 | Semiconductor Equip,-1.21% 86 | Shipbuilding & Marine,0.37% 87 | Shoe,24.27% 88 | Steel,-6.67% 89 | Telecom (Wireless),-15.63% 90 | Telecom. Equipment,15.67% 91 | Telecom. Services,5.78% 92 | Thrift,-79.47% 93 | Tobacco,214.71% 94 | Transportation,14.75% 95 | Trucking,16.01% 96 | Utility (General),7.34% 97 | Utility (Water),9.95% 98 | Total Market,15.68% 99 | -------------------------------------------------------------------------------- /DataSets/roemissing.csv: -------------------------------------------------------------------------------- 1 | Industry Name,Number of firms,ROE 2 | Advertising,65,16.51% 3 | Aerospace/Defense,95,21.60% 4 | Air Transport,25,42.68% 5 | Apparel,70,17.87% 6 | Auto & Truck,26,22.05% 7 | Auto Parts,75,17.54% 8 | Bank,7,15.03% 9 | Banks (Regional),721,9.52% 10 | Beverage ,47,27.62% 11 | Beverage (Alcoholic),19,18.28% 12 | Biotechnology,349,6.77% 13 | Broadcasting,30,74.10% 14 | Brokerage & Investment Banking,49,9.25% 15 | Building Materials,37,6.78% 16 | Business & Consumer Services,-999,12.48% 17 | Cable TV,16,26.62% 18 | Chemical (Basic),47,10000.00% 19 | Chemical (Diversified),10,145.00% 20 | Chemical (Specialty),100,22.10% 21 | Coal & Related Energy,45,-14.66% 22 | Computer Services,129,39.46% 23 | Computer Software,273,21.53% 24 | Computers/Peripherals,66,24.55% 25 | Construction,18,3.62% 26 | Diversified,20,13.06% 27 | Educational Services,40,-0.13% 28 | Electrical Equipment,135,13.67% 29 | Electronics,191,7.98% 30 | Electronics (Consumer & Office),26,25.66% 31 | Engineering,56,7.61% 32 | Entertainment,85,17.45% 33 | Environmental & Waste Services,108,8.28% 34 | Farming/Agriculture,29,4.82% 35 | Financial Svcs.,76,15.50% 36 | Financial Svcs. (Non-bank & Insurance),17,6.45% 37 | Food Processing,97,15.94% 38 | Food Wholesalers,18,17.74% 39 | Furn/Home Furnishings,36,12.99% 40 | Healthcare Equipment,193,11.87% 41 | Healthcare Facilities,47,26.29% 42 | Healthcare Products,58,5.52% 43 | Healthcare Services,126,13.14% 44 | Heathcare Information and Technology,125,9.45% 45 | Heavy Construction,46,22.00% 46 | Homebuilding,32,32.64% 47 | Hotel/Gaming,89,4.50% 48 | Household Products,139,21.68% 49 | Information Services,71,22.24% 50 | Insurance (General),26,4.08% 51 | Insurance (Life),27,6.08% 52 | Insurance (Prop/Cas.),53,14.34% 53 | Internet software and services,330,11.75% 54 | Investment Co.,65,9.68% 55 | Machinery,141,15.70% 56 | Metals & Mining,134,6.26% 57 | Office Equipment & Services,30,19.42% 58 | Oil/Gas (Integrated),8,18.31% 59 | Oil/Gas (Production and Exploration),411,6.74% 60 | Oil/Gas Distribution,80,12.66% 61 | Oilfield Svcs/Equip.,163,13.18% 62 | Packaging & Container,24,15.61% 63 | Paper/Forest Products,21,15.98% 64 | Pharma & Drugs,138,19.71% 65 | Power,106,8.70% 66 | Precious Metals,166,-8.92% 67 | Publshing & Newspapers,52,7.05% 68 | R.E.I.T.,46,12.55% 69 | Railroad,10,19.85% 70 | Real Estate (Development),22,-4.29% 71 | Real Estate (General/Diversified),11,1.02% 72 | Real Estate (Operations & Services),47,19.84% 73 | Recreation,70,18.03% 74 | Reinsurance,3,6.05% 75 | Restaurant,84,27.46% 76 | Retail (Automotive),30,30.79% 77 | Retail (Building Supply),7,23.12% 78 | Retail (Distributors),87,12.92% 79 | Retail (General),21,17.68% 80 | Retail (Grocery and Food),21,10.91% 81 | Retail (Internet),47,18.36% 82 | Retail (Special Lines),137,17.29% 83 | Rubber& Tires,4,45.41% 84 | Semiconductor,104,13.14% 85 | Semiconductor Equip,51,-1.21% 86 | Shipbuilding & Marine,14,0.37% 87 | Shoe,14,24.27% 88 | Steel,37,-6.67% 89 | Telecom (Wireless),28,-15.63% 90 | Telecom. Equipment,131,15.67% 91 | Telecom. Services,82,5.78% 92 | Thrift,223,-79.47% 93 | Tobacco,12,214.71% 94 | Transportation,22,14.75% 95 | Trucking,28,16.01% 96 | Utility (General),20,7.34% 97 | Utility (Water),20,9.95% 98 | Total Market,7766,15.68% 99 | -------------------------------------------------------------------------------- /DataSets/tb_deaths_100.csv: -------------------------------------------------------------------------------- 1 | "TB mortality, all forms (per 100 000 population per year)",1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007 2 | Afghanistan,50,49,48,47,47,46,46,45,43,43,41,39,36,37,34,33,31,30 3 | Albania,4,4,4,4,4,5,5,5,5,5,4,4,4,4,4,4,3,3 4 | Algeria,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 5 | American Samoa,5,2,0,2,2,2,0,9,2,1,1,1,1,0,1,1,1,0 6 | Andorra,4,4,4,4,3,3,3,2,3,3,2,3,3,2,2,2,2,2 7 | Angola,60,60,61,62,63,64,66,48,56,53,75,49,34,30,37,39,29,33 8 | Anguilla,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 9 | Antigua and Barbuda,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1 10 | Argentina,8,8,7,7,7,7,6,6,6,6,5,6,5,5,5,5,5,4 11 | Armenia,5,5,5,6,7,8,9,9,9,11,12,12,12,12,11,10,10,10 12 | Australia,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 13 | Austria,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1 14 | Azerbaijan,5,5,5,6,6,7,8,8,9,9,10,10,10,11,10,10,10,10 15 | Bahamas,11,11,11,11,11,11,11,10,11,8,7,7,9,9,9,9,9,9 16 | Bahrain,9,8,8,7,7,7,7,6,6,6,5,5,4,4,4,4,4,5 17 | Bangladesh,77,75,72,70,68,66,63,62,60,58,58,57,55,53,52,48,45,45 18 | Barbados,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 19 | Belarus,5,4,5,5,7,7,8,9,9,10,10,10,8,8,8,8,8,8 20 | Belgium,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1 21 | Belize,8,9,9,9,9,9,4,6,7,8,5,3,3,5,7,4,5,7 22 | Benin,15,15,15,15,15,15,17,17,18,17,17,17,19,20,19,19,18,18 23 | Bermuda,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 24 | Bhutan,101,95,90,85,81,76,72,69,63,63,60,58,55,53,51,48,47,44 25 | Bolivia,45,43,42,41,40,38,33,33,32,31,30,28,28,27,27,26,26,25 26 | Bosnia and Herzegovina,15,15,15,15,14,13,13,12,12,10,9,8,8,8,7,8,8,7 27 | Botswana,46,51,55,58,61,63,60,59,65,76,84,106,123,154,162,165,189,194 28 | Brazil,7,7,7,7,6,7,7,7,6,6,6,6,6,6,5,5,4,4 29 | British Virgin Islands,4,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2 30 | Brunei Darussalam,10,10,10,10,10,10,10,10,10,6,9,7,6,7,7,6,5,7 31 | Bulgaria,4,4,5,5,5,5,5,6,6,5,5,6,6,5,5,5,5,5 32 | Burkina Faso,32,35,37,39,41,43,45,49,53,58,63,69,74,76,76,74,71,69 33 | Burundi,43,49,56,61,65,68,71,71,86,81,87,98,106,110,110,109,107,102 34 | Cambodia,119,119,120,120,120,118,120,117,115,112,111,109,104,100,96,92,91,89 35 | Cameroon,24,28,31,34,38,41,44,49,51,54,56,59,58,53,53,45,42,39 36 | Canada,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 37 | Cape Verde,50,48,47,46,45,44,44,43,43,42,42,32,41,41,40,32,32,31 38 | Cayman Islands,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0 39 | Central African Republic,47,53,58,64,69,74,56,87,95,103,113,116,110,134,136,120,102,100 40 | Chad,31,34,37,40,43,46,55,65,72,66,73,79,89,103,99,94,91,90 41 | Chile,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,1,1 42 | China,25,24,24,23,22,22,21,21,20,20,20,20,19,18,17,16,15,15 43 | Colombia,9,9,9,9,9,8,8,8,8,7,6,7,7,7,7,6,5,5 44 | Comoros,15,14,13,12,11,10,10,11,9,10,9,8,8,8,7,7,7,6 45 | "Congo, Rep.",44,49,52,55,57,59,92,102,78,118,43,57,66,99,91,91,96,90 46 | Cook Islands,0,2,10,8,6,3,2,1,0,4,1,10,2,0,5,1,2,4 47 | Costa Rica,3,3,3,3,3,3,2,2,2,1,1,1,1,1,1,1,1,1 48 | Croatia,12,12,12,12,11,11,10,10,10,9,7,7,7,7,7,7,6,6 49 | Cuba,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1 50 | Cyprus,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 51 | Czech Republic,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1 52 | Cote d'Ivoire,48,56,61,67,72,78,84,91,99,110,125,151,145,148,147,145,136,128 53 | "Korea, Dem. Rep.",113,113,112,112,111,111,111,111,111,110,105,98,90,86,83,85,83,65 54 | "Congo, Dem. Rep.",35,39,41,44,47,51,53,58,59,65,73,79,86,87,87,86,85,82 55 | Denmark,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 56 | Djibouti,126,127,129,132,136,139,78,73,101,94,105,102,133,137,146,148,154,157 57 | Dominica,3,3,3,3,3,3,2,2,2,2,2,3,2,2,2,3,1,2 58 | Dominican Republic,27,27,26,26,25,25,22,24,23,22,21,20,17,15,15,14,14,13 59 | Ecuador,41,40,38,37,36,35,35,32,33,32,31,30,27,26,25,25,24,23 60 | Egypt,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,2 61 | El Salvador,15,14,14,13,13,12,13,11,11,10,10,10,9,9,8,8,8,7 62 | Equatorial Guinea,19,22,23,25,27,29,36,38,37,40,44,83,89,93,69,68,66,87 63 | Eritrea,20,20,21,21,22,22,23,22,21,14,14,14,14,14,15,16,17,16 64 | Estonia,4,4,5,5,6,7,8,9,10,10,10,9,9,9,8,7,7,6 65 | Ethiopia,40,45,50,55,59,64,64,65,69,76,79,88,92,97,98,98,96,92 66 | Fiji,9,8,8,7,7,6,6,6,5,5,5,4,4,4,4,4,3,4 67 | Finland,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 68 | France,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1 69 | French Polynesia,7,6,9,9,10,11,6,4,5,5,5,5,3,3,2,3,2,3 70 | Gabon,46,45,46,47,50,49,55,59,63,70,86,44,65,63,56,72,74,76 71 | Gambia,38,38,38,38,39,39,40,40,40,64,65,67,46,47,48,50,54,55 72 | Georgia,7,6,7,7,8,9,10,13,12,13,14,14,14,14,13,11,9,9 73 | Germany,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1 74 | Ghana,59,58,58,59,59,60,62,58,58,57,55,54,54,53,53,53,52,52 75 | Greece,4,4,4,4,3,3,3,3,3,3,3,3,2,2,2,2,2,2 76 | Grenada,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 77 | Guam,11,10,10,11,15,10,9,9,9,9,4,5,6,5,5,3,5,2 78 | Guatemala,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12 79 | Guinea,28,29,30,32,33,35,35,38,41,43,46,49,53,56,59,65,66,70 80 | Guinea-Bissau,40,40,41,42,43,44,46,52,56,58,42,44,48,47,42,45,43,44 81 | Guyana,6,7,6,8,10,13,15,16,17,18,18,21,22,24,22,22,22,24 82 | Haiti,81,82,83,84,84,84,85,84,82,80,79,78,76,74,73,71,71,71 83 | Honduras,17,16,16,15,15,14,16,16,12,10,6,7,7,9,10,10,10,10 84 | Hungary,6,6,6,6,6,6,7,6,6,5,5,4,4,4,3,3,3,2 85 | Iceland,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 86 | India,42,42,42,43,43,44,44,45,45,44,43,40,38,35,31,30,29,28 87 | Indonesia,92,89,85,82,79,75,73,70,67,63,62,59,54,51,47,43,40,39 88 | Iran,4,4,5,4,5,5,5,4,4,4,4,4,3,3,3,3,3,3 89 | Iraq,12,12,12,12,12,12,8,8,8,8,10,10,9,9,10,10,11,11 90 | Ireland,2,2,2,2,2,2,1,2,2,1,2,1,1,1,1,1,1,1 91 | Israel,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 92 | Italy,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 93 | Jamaica,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 94 | Japan,6,6,5,5,5,5,5,5,5,4,4,4,4,3,3,3,3,3 95 | Jordan,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 96 | Kazakhstan,8,7,7,7,7,8,8,12,12,17,15,17,18,20,19,18,18,17 97 | Kenya,25,27,33,41,49,61,69,83,93,102,113,105,103,100,98,90,73,65 98 | Kiribati,116,111,107,103,100,96,81,82,65,63,62,71,68,55,45,49,46,49 99 | Kuwait,5,5,5,4,4,4,4,3,3,3,3,3,3,3,3,3,2,2 100 | Kyrgyzstan,8,8,8,9,9,11,14,16,18,19,20,20,20,19,18,18,18,18 101 | Laos,38,37,36,35,34,33,30,29,28,28,28,27,27,26,26,24,24,24 102 | Latvia,4,5,5,5,6,8,10,12,12,12,12,12,12,11,10,9,9,8 103 | Lebanon,5,5,5,5,5,5,4,4,3,3,3,2,2,2,2,2,2,2 104 | Lesotho,28,31,34,38,43,49,51,41,57,219,76,79,92,89,93,115,85,263 105 | Liberia,57,59,61,63,65,66,60,62,58,60,65,65,57,65,56,63,60,62 106 | Libyan Arab Jamahiriya,5,5,5,5,5,5,4,4,4,2,2,2,2,1,1,1,1,1 107 | Lithuania,4,5,5,6,6,7,8,9,11,11,10,10,10,9,9,8,7,9 108 | Luxembourg,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1 109 | Madagascar,38,38,38,38,38,38,38,38,39,40,41,42,43,43,44,47,45,48 110 | Malawi,62,73,85,96,105,110,111,117,119,118,126,119,123,119,116,116,109,102 111 | Malaysia,21,21,20,20,19,19,19,24,24,24,18,18,19,18,19,18,18,18 112 | Maldives,7,7,6,6,5,5,5,7,7,7,7,7,6,5,5,5,5,4 113 | Mali,74,74,74,75,75,76,77,79,81,83,85,86,86,87,88,89,90,90 114 | Malta,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 115 | Mauritania,63,63,63,64,64,64,66,64,73,75,78,81,83,85,67,76,75,75 116 | Mauritius,5,5,4,4,4,4,5,5,4,3,3,4,4,4,3,4,4,4 117 | Mexico,11,10,10,9,8,8,7,7,6,6,5,4,4,4,4,3,3,2 118 | "Micronesia, Fed. Sts.",33,31,29,28,26,24,23,27,26,25,20,19,17,16,15,14,13,9 119 | Monaco,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 120 | Mongolia,48,47,47,46,45,44,38,38,38,37,37,36,34,35,29,28,21,29 121 | Montserrat,2,2,2,2,2,2,2,2,1,1,2,2,2,1,2,1,2,1 122 | Morocco,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,9,9,8 123 | Mozambique,37,42,46,50,55,61,68,77,87,98,111,124,133,139,140,138,133,127 124 | Myanmar,52,53,53,53,54,54,47,48,49,47,43,39,33,23,18,13,13,13 125 | Namibia,84,96,107,119,132,146,57,55,57,71,87,82,100,97,109,118,123,102 126 | Nauru,19,32,30,29,9,27,27,26,26,7,4,8,5,5,19,6,24,3 127 | Nepal,51,49,48,47,46,45,43,41,39,32,29,28,27,25,24,24,23,23 128 | Netherlands,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 129 | Netherlands Antilles,3,3,2,2,2,2,2,2,2,2,2,1,1,2,1,1,1,1 130 | New Caledonia,10,10,10,7,6,6,4,8,7,5,4,4,3,3,2,2,2,2 131 | New Zealand,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 132 | Nicaragua,18,17,16,16,15,14,13,13,12,12,11,11,10,10,9,9,9,6 133 | Niger,36,36,36,37,37,37,39,35,35,35,35,36,37,36,38,37,38,38 134 | Nigeria,35,40,43,47,52,56,60,66,72,78,86,93,100,103,102,101,97,93 135 | Niue,13,13,12,12,11,11,15,0,0,40,0,0,82,0,0,0,0,0 136 | Northern Mariana Islands,13,17,26,16,15,15,16,24,23,19,10,13,8,9,7,6,8,7 137 | Norway,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 138 | Oman,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 139 | Pakistan,49,49,49,49,49,49,49,49,48,49,49,48,45,44,42,38,34,29 140 | Palau,12,8,5,30,47,21,7,7,4,31,8,7,6,8,5,12,6,8 141 | Panama,7,7,7,7,7,7,7,8,7,7,7,6,4,5,4,4,4,4 142 | Papua New Guinea,68,67,66,66,65,64,66,64,58,60,59,58,54,52,48,48,51,60 143 | Paraguay,12,12,12,12,12,12,9,12,13,13,12,12,12,12,12,11,10,10 144 | Peru,34,32,31,29,27,26,29,28,23,25,24,22,21,21,19,18,16,16 145 | Philippines,87,86,84,83,81,82,81,78,74,70,57,53,50,47,46,44,41,41 146 | Poland,8,8,8,8,8,7,7,6,6,5,5,5,4,4,4,4,4,3 147 | Portugal,7,6,6,6,6,6,6,5,5,5,5,4,4,5,4,4,4,3 148 | Puerto Rico,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1 149 | Qatar,6,6,6,6,7,8,7,7,7,7,7,7,7,7,6,6,7,7 150 | "Korea, Rep.",19,16,15,13,12,11,11,10,9,8,9,8,9,9,9,10,10,10 151 | Moldova,9,8,9,9,11,12,14,15,18,19,20,20,20,20,19,19,19,19 152 | Romania,8,9,10,11,12,13,15,15,17,18,19,19,20,20,19,19,18,16 153 | Russian Federation,7,7,7,8,10,12,15,17,19,19,21,21,20,20,20,18,18,18 154 | Rwanda,67,73,76,79,82,85,89,92,96,105,118,130,138,141,142,138,131,128 155 | Saint Kitts and Nevis,2,2,2,2,2,2,2,2,1,1,2,2,1,2,2,2,2,1 156 | Saint Lucia,3,3,3,3,3,3,2,1,2,2,2,2,2,2,2,2,2,2 157 | Saint Vincent and the Grenadines,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,5 158 | Samoa,5,4,4,4,4,4,4,4,5,3,3,4,2,3,3,3,3,3 159 | San Marino,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 160 | Sao Tome and Principe,38,37,36,35,34,33,32,31,30,30,30,29,29,27,28,27,26,26 161 | Saudi Arabia,5,4,4,4,5,5,5,5,6,6,6,5,5,5,5,5,5,5 162 | Senegal,42,42,42,42,42,43,43,45,47,50,50,52,55,55,58,60,62,64 163 | Seychelles,9,8,8,8,7,7,5,4,5,7,5,5,4,5,4,5,5,5 164 | Sierra Leone,53,57,60,65,69,73,72,78,85,90,97,103,111,120,128,135,142,149 165 | Singapore,6,6,6,5,5,5,5,5,5,5,4,4,4,3,3,3,2,3 166 | Slovakia,7,7,7,8,7,7,6,6,5,5,4,4,4,3,3,3,3,3 167 | Slovenia,5,5,5,4,4,4,4,4,4,4,3,3,3,2,2,2,2,2 168 | Solomon Islands,70,66,61,57,53,50,42,39,37,36,33,32,30,28,26,24,23,21 169 | Somalia,86,85,84,84,83,82,76,75,75,75,74,69,69,65,55,52,57,63 170 | South Africa,78,78,82,112,114,116,126,133,144,129,183,213,194,227,233,249,232,230 171 | Spain,6,6,5,5,5,4,4,4,4,4,4,3,3,3,3,3,3,3 172 | Sri Lanka,10,10,10,10,10,10,10,9,9,9,10,9,9,9,9,7,8,8 173 | Sudan,62,63,64,65,65,66,67,68,63,64,64,66,64,66,67,68,69,71 174 | Suriname,14,13,10,11,10,11,12,15,18,18,18,18,19,20,22,24,26,29 175 | Swaziland,79,83,86,96,113,137,163,200,240,324,362,415,237,239,277,309,322,317 176 | Sweden,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1 177 | Switzerland,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 178 | Syrian Arab Republic,6,5,5,5,5,4,4,4,4,3,3,3,3,3,2,2,2,2 179 | Tajikistan,20,17,12,9,9,12,16,17,19,20,23,26,30,31,35,38,42,46 180 | Thailand,30,31,31,31,31,31,31,30,28,26,25,22,22,21,21,21,21,21 181 | "Macedonia, FYR",11,11,11,11,11,10,10,9,9,8,7,6,6,6,5,5,5,5 182 | Timor-Leste,73,72,72,71,71,70,70,70,70,70,70,70,37,45,46,46,48,47 183 | Togo,88,91,94,98,102,104,108,119,116,120,122,124,131,129,130,131,133,138 184 | Tokelau,33,33,33,26,0,68,0,12,12,0,0,0,24,0,12,0,0,0 185 | Tonga,6,6,6,5,5,5,3,4,2,4,3,5,3,3,4,3,3,2 186 | Trinidad and Tobago,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 187 | Tunisia,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3 188 | Turkey,8,8,8,8,7,7,7,7,7,6,5,5,5,5,5,5,5,5 189 | Turkmenistan,9,9,9,9,9,8,9,11,13,14,13,13,12,12,11,10,10,9 190 | Turks and Caicos Islands,5,5,4,4,4,4,4,4,3,1,1,3,2,2,2,2,2,1 191 | Tuvalu,62,59,56,53,50,48,46,44,43,41,40,39,37,36,35,29,30,17 192 | Uganda,69,106,115,125,129,133,130,99,100,98,103,104,110,114,110,107,100,93 193 | Ukraine,6,5,6,6,7,7,8,9,10,11,12,13,14,15,15,15,14,15 194 | United Arab Emirates,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2 195 | United Kingdom,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 196 | Tanzania,42,48,53,58,64,69,74,80,82,86,89,88,92,91,88,86,82,78 197 | Virgin Islands (U.S.),3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2 198 | United States of America,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 199 | Uruguay,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 200 | Uzbekistan,10,9,9,11,11,11,10,11,11,12,12,14,15,15,16,16,16,16 201 | Vanuatu,31,30,28,27,25,24,23,21,20,18,16,14,16,15,14,15,12,12 202 | Venezuela,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 203 | Viet Nam,33,33,32,32,32,31,29,26,25,25,25,25,24,24,24,24,24,24 204 | Wallis et Futuna,15,40,7,19,19,10,10,12,10,10,11,2,28,12,5,4,7,3 205 | West Bank and Gaza,6,5,5,5,5,5,5,5,4,4,4,4,4,4,3,3,3,3 206 | Yemen,18,17,18,17,17,16,16,15,14,13,12,12,12,11,11,10,10,10 207 | Zambia,126,153,182,203,218,229,238,247,250,258,255,274,156,138,137,138,128,115 208 | Zimbabwe,140,161,176,193,208,225,239,253,141,155,185,197,216,253,253,263,268,265 -------------------------------------------------------------------------------- /DataSets/tb_existing_100.csv: -------------------------------------------------------------------------------- 1 | "TB prevalence, all forms (per 100 000 population per year)",1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007 2 | Afghanistan,436,429,422,415,407,397,397,387,374,373,346,326,304,308,283,267,251,238 3 | Albania,42,40,41,42,42,43,42,44,43,42,40,34,32,32,29,29,26,22 4 | Algeria,45,44,44,43,43,42,43,44,45,46,48,49,50,51,52,53,55,56 5 | American Samoa,42,14,4,18,17,22,0,25,12,8,8,6,5,6,9,11,9,5 6 | Andorra,39,37,35,33,32,30,28,23,24,22,20,20,21,18,19,18,17,19 7 | Angola,514,514,513,512,510,508,512,363,414,384,530,335,307,281,318,331,302,294 8 | Anguilla,38,38,37,37,36,35,35,36,36,36,35,35,35,35,35,34,34,34 9 | Antigua and Barbuda,16,15,15,14,13,12,12,11,11,9,8,9,7,9,8,8,9,9 10 | Argentina,96,91,86,82,78,74,71,67,63,58,52,51,42,41,39,39,37,35 11 | Armenia,52,49,51,55,60,68,74,75,74,86,94,99,97,91,85,79,79,81 12 | Australia,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6 13 | Austria,18,17,16,15,15,14,13,13,12,12,11,11,11,10,10,10,10,10 14 | Azerbaijan,58,55,57,61,67,76,85,91,100,106,113,117,99,109,90,85,86,86 15 | Bahamas,54,53,52,52,53,54,54,54,55,46,45,45,51,51,50,50,50,51 16 | Bahrain,120,113,108,101,97,92,89,86,83,67,57,56,55,53,48,45,45,60 17 | Bangladesh,639,623,608,594,579,576,550,535,516,492,500,491,478,458,444,416,392,387 18 | Barbados,8,8,7,7,6,6,6,6,5,5,5,4,4,4,4,4,3,3 19 | Belarus,62,54,59,62,75,82,91,98,109,113,110,100,89,68,68,68,69,69 20 | Belgium,16,15,15,15,15,14,13,13,12,12,12,13,12,11,11,11,10,9 21 | Belize,65,64,62,59,57,55,37,41,53,53,39,36,36,40,42,38,41,46 22 | Benin,140,138,135,132,129,125,127,129,130,128,128,129,137,139,134,135,134,135 23 | Bermuda,10,10,9,9,8,8,8,8,7,7,7,6,6,6,6,6,6,6 24 | Bhutan,924,862,804,750,699,651,620,597,551,538,515,512,472,460,443,412,406,363 25 | Bolivia,377,362,347,333,320,306,271,264,254,248,238,229,223,218,211,205,202,198 26 | Bosnia and Herzegovina,160,156,154,150,143,134,131,125,96,80,70,63,66,63,55,58,58,55 27 | Botswana,344,355,351,349,347,349,336,349,371,413,445,497,535,586,598,599,621,622 28 | Brazil,124,119,114,109,104,100,97,93,88,86,83,80,77,72,63,60,56,60 29 | British Virgin Islands,32,30,28,26,25,23,22,21,20,19,19,18,18,17,16,17,16,16 30 | Brunei Darussalam,91,91,91,91,91,91,91,88,88,93,108,85,78,73,63,55,59,65 31 | Bulgaria,43,48,54,57,58,57,59,65,68,68,64,63,52,42,40,41,40,41 32 | Burkina Faso,179,196,208,221,233,246,251,271,286,308,338,368,398,419,426,421,411,403 33 | Burundi,288,302,292,293,305,322,339,346,424,412,455,522,581,619,639,654,657,647 34 | Cambodia,928,905,881,858,836,811,810,789,777,764,758,750,728,712,696,676,672,664 35 | Cameroon,188,199,200,199,197,197,196,207,212,219,228,241,240,227,228,213,201,195 36 | Canada,7,7,7,6,6,6,5,5,5,5,5,4,4,4,4,4,4,4 37 | Cape Verde,449,438,428,418,408,398,394,391,387,384,380,283,374,370,367,278,285,280 38 | Cayman Islands,10,10,9,9,8,8,8,8,7,7,7,5,6,6,5,5,6,5 39 | Central African Republic,318,336,342,350,356,365,270,395,419,449,485,495,468,566,574,507,437,425 40 | Chad,251,272,282,294,304,315,354,408,433,390,420,450,502,573,548,518,505,497 41 | Chile,45,41,38,35,32,30,28,25,24,22,21,19,19,18,15,15,13,12 42 | China,327,321,315,309,303,303,290,283,276,273,269,265,259,241,220,206,200,194 43 | Colombia,88,85,82,79,76,73,71,69,67,61,51,62,60,58,55,53,44,43 44 | Comoros,188,177,167,157,148,140,130,155,120,143,112,103,104,107,99,91,86,83 45 | "Congo, Rep.",209,222,231,243,255,269,424,457,367,545,313,354,402,509,477,482,511,485 46 | Cook Islands,0,10,57,47,38,19,10,13,0,40,12,29,11,0,15,9,16,31 47 | Costa Rica,30,28,27,26,25,24,23,22,21,19,14,14,15,14,12,12,12,11 48 | Croatia,126,123,121,118,113,106,103,102,99,89,76,73,69,68,67,65,65,54 49 | Cuba,32,29,26,24,22,20,18,17,15,14,13,12,11,10,9,8,8,7 50 | Cyprus,14,13,13,12,11,11,11,10,7,7,9,8,7,6,6,6,6,6 51 | Czech Republic,22,22,22,21,21,21,21,21,19,18,16,14,13,12,11,11,10,9 52 | Cote d'Ivoire,292,304,306,309,312,319,329,350,376,413,472,571,561,590,604,613,597,582 53 | "Korea, Dem. Rep.",841,828,815,802,788,775,775,775,775,770,713,650,577,527,499,508,500,441 54 | "Congo, Dem. Rep.",275,306,327,352,376,411,420,466,472,528,592,643,697,708,710,702,692,666 55 | Denmark,12,12,11,10,10,9,9,8,8,8,7,7,7,7,7,6,7,6 56 | Djibouti,"1,485","1,477","1,463","1,442","1,414","1,381",720,669,698,701,761,775,932,960,"1,034","1,046","1,093","1,104" 57 | Dominica,24,24,24,23,23,22,22,18,20,20,20,22,20,20,20,21,13,19 58 | Dominican Republic,183,173,164,156,148,141,135,132,128,122,119,115,102,93,90,85,84,82 59 | Ecuador,282,271,259,249,238,228,221,212,207,200,194,185,170,162,155,155,148,140 60 | Egypt,48,47,47,45,45,44,51,46,43,40,36,34,32,31,29,28,27,27 61 | El Salvador,133,126,119,112,105,99,97,80,76,72,69,66,62,60,57,52,50,48 62 | Equatorial Guinea,169,181,187,194,200,207,216,222,236,253,274,441,470,490,370,366,358,469 63 | Eritrea,245,245,242,239,235,232,232,225,203,114,114,111,118,110,122,127,133,134 64 | Estonia,50,50,56,66,77,85,88,98,102,105,72,68,62,56,50,46,44,39 65 | Ethiopia,312,337,351,366,383,403,396,397,420,464,486,539,569,601,613,612,604,579 66 | Fiji,68,65,62,58,55,53,49,49,46,40,42,35,36,29,33,31,30,30 67 | Finland,14,12,11,10,9,10,10,10,9,9,8,7,7,6,6,5,5,5 68 | France,21,20,19,18,17,16,15,15,14,14,13,12,12,12,12,11,11,11 69 | French Polynesia,67,55,91,83,93,107,55,48,56,54,40,42,32,29,28,31,31,32 70 | Gabon,359,340,325,318,316,293,312,320,359,366,434,249,302,299,288,332,358,379 71 | Gambia,350,350,349,347,344,341,324,321,311,485,491,499,335,343,341,366,399,404 72 | Georgia,51,48,50,54,59,66,73,104,87,90,98,95,95,94,90,86,83,83 73 | Germany,15,15,14,14,13,13,12,11,11,10,9,8,7,6,6,6,5,5 74 | Ghana,533,519,502,480,455,432,426,388,384,382,368,358,359,358,359,357,355,353 75 | Greece,30,29,27,25,24,23,22,22,21,20,19,18,18,17,17,16,16,16 76 | Grenada,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6 77 | Guam,103,101,96,110,146,93,91,89,87,86,44,45,44,47,41,42,39,36 78 | Guatemala,113,111,108,106,103,100,95,94,93,92,90,91,89,89,86,85,84,87 79 | Guinea,241,248,255,262,269,275,277,293,305,317,332,346,363,380,391,425,426,448 80 | Guinea-Bissau,404,403,402,399,395,390,390,387,385,386,273,276,305,296,287,283,270,276 81 | Guyana,39,43,34,43,50,67,78,81,90,93,98,112,126,136,130,132,133,136 82 | Haiti,479,464,453,443,435,429,428,426,417,407,403,397,388,380,377,368,368,366 83 | Honduras,141,133,128,123,119,115,114,112,106,98,70,70,72,71,72,71,70,71 84 | Hungary,67,68,70,72,73,73,74,72,67,47,43,39,36,33,29,26,22,19 85 | Iceland,5,4,4,4,4,4,3,3,3,3,3,3,2,2,2,3,3,3 86 | India,586,577,566,555,542,525,517,501,487,476,443,411,389,349,311,299,290,283 87 | Indonesia,443,430,417,404,392,380,369,359,348,335,326,314,297,287,274,261,251,244 88 | Iran,50,51,56,54,55,55,61,52,45,41,40,38,37,35,32,31,29,27 89 | Iraq,88,88,88,88,88,88,84,84,82,80,71,69,65,67,71,75,78,79 90 | Ireland,19,18,18,17,15,14,12,12,12,12,12,11,10,10,10,10,10,11 91 | Israel,11,10,10,9,9,8,8,8,8,7,7,7,6,6,6,6,6,6 92 | Italy,11,10,10,9,9,8,9,8,7,7,7,7,7,6,6,6,6,6 93 | Jamaica,10,10,10,10,9,9,7,7,7,7,7,7,7,7,7,7,7,7 94 | Japan,62,60,58,56,53,51,50,50,49,48,45,41,39,36,34,32,30,28 95 | Jordan,19,18,17,17,16,15,20,18,12,11,11,9,9,9,9,8,9,9 96 | Kazakhstan,95,87,85,84,85,94,109,137,163,134,141,148,150,155,152,147,144,139 97 | Kenya,125,120,134,152,177,207,233,277,313,351,393,384,392,402,410,388,340,319 98 | Kiribati,"1,026","1,006",986,966,947,928,910,853,571,556,546,607,587,477,439,419,405,423 99 | Kuwait,89,84,80,75,72,68,66,64,61,35,33,33,30,29,29,30,25,25 100 | Kyrgyzstan,90,93,93,93,101,118,141,165,147,146,156,169,153,145,139,136,135,134 101 | Laos,428,424,420,415,411,407,373,360,352,344,344,337,330,324,313,298,291,289 102 | Latvia,56,57,59,63,75,91,77,89,92,95,91,89,85,78,72,66,61,55 103 | Lebanon,64,64,63,62,62,59,64,54,50,37,35,30,26,24,22,21,23,23 104 | Lesotho,225,231,229,228,232,242,248,264,298,518,356,370,399,408,414,421,408,568 105 | Liberia,476,473,469,465,462,461,418,424,396,403,435,437,382,429,370,416,393,398 106 | Libyan Arab Jamahiriya,46,45,45,43,43,42,41,38,36,23,22,22,21,20,19,18,18,17 107 | Lithuania,64,66,71,79,89,98,110,119,125,120,115,96,83,72,72,66,65,69 108 | Luxembourg,19,18,17,16,15,14,14,13,13,12,11,11,11,10,10,10,10,9 109 | Madagascar,367,368,369,369,370,370,339,345,346,352,359,371,382,375,384,408,400,417 110 | Malawi,380,376,365,355,353,348,337,342,345,349,362,350,358,353,346,342,324,305 111 | Malaysia,159,158,156,155,153,151,147,173,170,167,135,133,132,128,128,126,123,121 112 | Maldives,143,130,118,107,97,88,88,101,89,94,96,84,83,69,71,63,69,48 113 | Mali,640,631,621,609,597,583,573,566,565,567,571,573,572,578,584,589,593,599 114 | Malta,10,9,9,8,8,7,7,7,7,6,6,6,5,5,5,5,5,5 115 | Mauritania,585,587,590,592,594,595,622,615,612,615,619,624,632,642,494,565,556,559 116 | Mauritius,53,51,50,48,47,45,62,61,45,40,39,42,40,39,38,39,39,39 117 | Mexico,101,93,86,80,74,68,64,58,52,48,42,38,35,33,31,27,25,23 118 | "Micronesia, Fed. Sts.",263,253,244,234,225,217,204,287,276,265,173,171,152,142,128,124,112,100 119 | Monaco,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2 120 | Mongolia,477,477,477,477,477,477,333,342,307,281,297,273,258,258,233,232,217,234 121 | Montserrat,14,14,14,14,14,13,13,13,13,13,13,13,13,10,13,10,12,8 122 | Morocco,134,130,127,123,119,116,107,106,105,99,98,95,87,91,89,85,82,80 123 | Mozambique,287,313,328,343,356,369,386,408,432,461,499,535,556,569,567,551,528,504 124 | Myanmar,411,400,389,379,370,361,298,309,312,298,267,238,202,175,168,161,161,162 125 | Namibia,650,685,687,683,671,658,387,395,411,442,481,506,544,560,572,570,556,532 126 | Nauru,170,285,280,274,90,263,258,253,248,44,44,56,57,48,162,121,174,33 127 | Nepal,629,607,585,564,543,523,498,473,448,363,312,304,285,271,260,247,246,240 128 | Netherlands,11,10,10,9,9,8,8,8,8,7,7,7,6,6,6,6,6,6 129 | Netherlands Antilles,28,27,25,24,23,22,21,20,19,18,17,17,17,16,16,15,15,15 130 | New Caledonia,112,107,104,76,69,60,58,97,97,51,51,43,34,28,29,29,25,25 131 | New Zealand,10,10,9,9,10,11,10,10,11,11,11,10,10,10,10,9,8,7 132 | Nicaragua,145,137,129,122,114,108,100,97,93,89,85,80,79,73,69,68,64,56 133 | Niger,317,318,319,319,319,318,322,292,281,281,278,280,288,275,287,285,289,292 134 | Nigeria,282,307,321,336,350,366,379,399,423,452,489,526,563,575,573,563,543,521 135 | Niue,118,115,113,111,109,106,202,0,0,114,0,0,506,0,0,0,0,0 136 | Northern Mariana Islands,142,201,301,194,186,185,188,331,334,220,135,120,95,83,80,83,83,72 137 | Norway,8,8,8,7,7,6,6,6,6,5,5,5,5,5,4,4,4,4 138 | Oman,40,36,29,25,22,22,15,15,14,14,13,14,13,13,12,13,13,14 139 | Pakistan,430,428,427,426,424,422,421,421,415,420,413,406,376,355,333,289,260,223 140 | Palau,96,66,43,260,414,187,53,92,54,376,104,102,69,64,31,102,74,71 141 | Panama,74,73,71,70,69,68,67,67,65,64,60,51,48,49,44,44,44,45 142 | Papua New Guinea,498,498,497,497,496,496,494,493,491,489,486,482,477,471,463,453,441,430 143 | Paraguay,95,93,92,91,89,88,71,92,92,91,90,89,88,85,85,81,74,73 144 | Peru,394,368,343,320,298,278,270,251,230,222,210,198,187,182,167,155,143,136 145 | Philippines,799,783,766,750,735,719,705,689,669,649,600,578,561,542,534,520,505,500 146 | Poland,88,87,86,85,83,79,74,68,63,58,53,50,35,34,33,31,29,28 147 | Portugal,51,49,47,45,44,43,42,41,39,38,36,34,33,32,29,27,24,23 148 | Puerto Rico,17,15,17,18,18,18,15,13,12,10,9,8,7,6,6,6,6,5 149 | Qatar,71,69,69,74,84,89,87,84,75,78,78,78,75,71,71,69,77,81 150 | "Korea, Rep.",223,196,174,150,142,132,105,98,89,107,113,112,126,108,112,118,122,126 151 | Moldova,105,99,103,111,122,138,157,171,191,203,215,174,211,176,152,151,151,151 152 | Romania,118,125,134,147,159,167,174,184,129,194,197,206,180,185,178,148,138,128 153 | Russian Federation,69,64,70,78,91,111,132,142,155,160,164,158,148,140,135,121,117,115 154 | Rwanda,190,211,226,243,259,278,297,316,339,383,442,503,549,581,607,607,595,590 155 | Saint Kitts and Nevis,17,17,16,16,16,15,16,15,11,12,15,13,12,14,13,15,14,12 156 | Saint Lucia,26,26,25,25,25,24,23,17,16,18,20,18,17,19,18,18,18,18 157 | Saint Vincent and the Grenadines,45,45,44,43,42,42,42,41,38,41,35,36,36,34,36,36,34,39 158 | Samoa,36,35,34,33,32,31,35,33,50,31,27,33,28,28,24,27,26,25 159 | San Marino,9,9,8,8,7,7,7,7,7,6,6,6,6,5,5,5,5,5 160 | Sao Tome and Principe,346,335,325,315,304,295,290,285,290,276,272,266,261,266,255,256,252,240 161 | Saudi Arabia,68,60,59,60,64,67,71,73,76,72,67,65,62,60,60,60,62,65 162 | Senegal,380,379,379,378,377,376,372,388,397,424,420,430,443,441,454,456,461,468 163 | Seychelles,113,110,106,103,100,96,66,59,71,90,52,53,42,66,52,57,56,55 164 | Sierra Leone,465,479,492,504,517,534,525,565,602,636,675,696,743,784,830,866,902,941 165 | Singapore,52,52,53,50,49,49,50,50,48,44,39,36,34,32,31,28,27,27 166 | Slovakia,55,56,59,59,56,51,46,42,38,35,32,30,29,26,25,21,20,20 167 | Slovenia,66,62,59,57,53,50,35,35,32,29,27,25,22,21,19,16,16,15 168 | Solomon Islands,625,593,563,534,506,480,380,354,339,322,300,286,277,254,229,204,197,180 169 | Somalia,597,587,577,566,555,543,465,444,446,431,414,398,391,362,334,325,341,352 170 | South Africa,769,726,676,620,562,502,480,466,465,426,515,581,586,649,676,707,690,692 171 | Spain,44,42,40,37,35,34,33,30,30,28,27,26,26,25,24,24,24,23 172 | Sri Lanka,109,106,104,102,99,97,102,93,90,89,107,99,88,89,87,75,80,79 173 | Sudan,409,404,402,402,403,405,409,417,378,382,375,389,363,371,376,384,391,402 174 | Suriname,109,100,79,80,76,78,88,101,118,122,115,113,113,120,126,136,146,155 175 | Swaziland,629,590,527,477,448,441,460,504,556,647,740,832,693,739,776,788,801,812 176 | Sweden,5,5,6,6,5,5,5,4,4,4,4,4,4,4,4,4,4,5 177 | Switzerland,14,13,12,11,10,10,9,8,8,8,7,6,6,6,6,5,5,5 178 | Syrian Arab Republic,94,89,84,80,75,71,67,61,54,48,41,37,35,33,31,30,29,27 179 | Tajikistan,193,162,112,79,85,106,134,141,159,169,191,221,248,256,277,282,301,322 180 | Thailand,336,319,307,297,291,285,285,279,256,231,223,194,197,189,188,184,189,192 181 | "Macedonia, FYR",92,90,89,86,83,77,74,73,72,65,56,39,40,37,34,34,34,33 182 | Timor-Leste,706,694,681,669,656,644,644,644,644,644,644,644,345,359,367,370,385,378 183 | Togo,702,687,668,647,628,614,613,658,637,647,656,669,701,693,702,713,726,750 184 | Tokelau,139,140,143,112,0,301,0,112,112,0,0,0,112,0,112,0,0,0 185 | Tonga,45,44,43,43,42,41,38,38,31,34,34,42,35,36,39,32,34,28 186 | Trinidad and Tobago,17,17,17,16,16,16,16,16,15,15,15,16,15,15,15,15,15,15 187 | Tunisia,49,46,49,51,51,49,48,46,44,31,30,28,27,26,27,27,28,28 188 | Turkey,83,79,77,73,68,62,62,63,64,57,49,45,44,43,44,44,32,34 189 | Turkmenistan,105,99,101,97,92,80,92,114,137,142,130,115,110,103,98,91,85,75 190 | Turks and Caicos Islands,42,40,37,35,33,31,30,29,28,17,16,23,23,22,22,22,18,17 191 | Tuvalu,593,573,554,535,518,500,484,467,452,437,422,408,394,381,368,245,261,203 192 | Uganda,206,313,342,377,394,418,419,342,357,359,391,411,447,476,472,469,450,426 193 | Ukraine,67,64,67,72,75,78,87,93,104,109,120,128,133,135,132,113,99,102 194 | United Arab Emirates,47,44,42,39,38,36,34,33,31,30,27,27,27,25,25,24,24,24 195 | United Kingdom,9,9,10,10,9,9,9,9,9,9,9,9,9,10,10,11,11,12 196 | Tanzania,215,228,240,252,269,283,301,324,333,347,364,367,383,380,373,364,353,337 197 | Virgin Islands (U.S.),30,28,27,25,24,23,19,18,17,19,19,18,18,17,17,16,16,16 198 | United States of America,7,7,7,7,6,6,6,5,5,4,4,4,4,4,3,3,3,3 199 | Uruguay,35,34,33,32,31,30,28,27,28,28,27,25,27,25,23,24,25,23 200 | Uzbekistan,114,105,102,118,116,119,111,122,129,134,139,148,144,152,149,144,134,140 201 | Vanuatu,278,268,259,250,242,234,226,218,211,159,143,128,149,128,118,131,104,102 202 | Venezuela,46,45,44,43,42,42,41,41,40,39,39,41,41,39,38,38,38,39 203 | Viet Nam,365,361,358,354,350,346,312,273,261,253,248,243,235,234,226,227,222,220 204 | Wallis et Futuna,126,352,64,174,172,93,123,213,107,105,103,13,275,147,63,57,60,25 205 | West Bank and Gaza,55,54,54,52,52,50,49,46,44,42,40,39,37,36,35,33,32,31 206 | Yemen,265,261,263,253,250,244,233,207,194,175,164,154,149,146,138,137,135,130 207 | Zambia,436,456,494,526,556,585,602,626,634,657,658,680,517,478,468,453,422,387 208 | Zimbabwe,409,417,415,419,426,439,453,481,392,430,479,523,571,632,652,680,699,714 -------------------------------------------------------------------------------- /DataSets/tb_new_100.csv: -------------------------------------------------------------------------------- 1 | "TB incidence, all forms (per 100 000 population per year)",1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007 2 | Afghanistan,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168 3 | Albania,25,24,25,26,26,27,27,28,28,27,25,23,23,22,21,20,18,17 4 | Algeria,38,38,39,40,41,42,43,44,46,47,48,49,50,51,53,54,55,57 5 | American Samoa,21,7,2,9,9,11,0,12,6,8,6,6,4,5,9,10,7,5 6 | Andorra,36,34,32,30,29,27,26,26,25,23,22,21,21,20,20,19,19,19 7 | Angola,205,209,214,218,222,226,231,236,240,245,250,255,260,265,270,276,281,287 8 | Anguilla,24,24,24,24,23,23,23,23,23,23,23,22,22,22,22,22,22,22 9 | Antigua and Barbuda,10,10,9,9,8,8,8,7,7,7,6,6,6,6,6,6,6,5 10 | Argentina,60,57,55,53,51,49,47,45,44,42,40,39,37,36,35,33,32,31 11 | Armenia,33,32,33,37,41,47,53,58,63,67,71,72,72,71,71,72,72,72 12 | Australia,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6 13 | Austria,23,22,21,20,19,18,17,17,16,15,14,14,14,13,13,13,13,12 14 | Azerbaijan,35,34,36,39,43,50,56,62,67,71,75,77,77,76,76,77,77,77 15 | Bahamas,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44 16 | Bahrain,76,72,68,64,61,58,57,55,52,49,47,46,45,43,42,42,41,40 17 | Bangladesh,264,261,259,256,253,251,248,246,244,241,239,236,234,232,229,227,225,223 18 | Barbados,7,6,6,6,6,5,5,5,5,4,4,4,4,4,4,4,4,4 19 | Belarus,38,34,38,40,49,54,60,65,72,76,73,66,60,60,61,61,61,61 20 | Belgium,20,19,18,19,19,18,17,16,15,15,16,16,15,14,13,13,13,12 21 | Belize,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40 22 | Benin,77,77,78,79,80,80,81,82,83,84,85,86,86,87,88,89,90,91 23 | Bermuda,7,6,6,6,6,5,5,5,5,4,4,4,4,4,4,4,4,4 24 | Bhutan,540,516,492,470,449,428,409,391,373,356,340,325,310,296,283,270,258,246 25 | Bolivia,255,247,240,233,226,220,213,207,201,195,190,184,179,174,169,164,159,155 26 | Bosnia and Herzegovina,94,92,93,92,89,84,83,81,79,71,63,58,56,55,53,52,52,51 27 | Botswana,307,341,364,390,415,444,468,503,542,588,640,692,740,772,780,770,751,731 28 | Brazil,84,81,78,76,73,71,69,67,64,62,60,58,57,55,53,51,50,48 29 | British Virgin Islands,19,18,17,16,15,15,14,14,13,12,12,11,11,11,11,11,10,10 30 | Brunei Darussalam,58,58,58,58,58,58,58,58,58,93,102,70,73,64,53,48,59,59 31 | Bulgaria,27,30,34,37,38,38,39,43,45,45,44,44,43,39,39,40,39,39 32 | Burkina Faso,95,105,112,120,128,137,145,155,168,182,198,214,229,239,241,238,232,226 33 | Burundi,154,171,182,196,208,223,235,252,272,295,321,347,371,387,391,387,377,367 34 | Cambodia,585,579,574,568,563,557,552,546,541,536,530,525,520,515,510,505,500,495 35 | Cameroon,81,89,95,102,109,116,123,132,142,154,168,181,194,202,204,202,197,192 36 | Canada,10,9,9,8,8,7,7,7,7,6,6,6,6,5,5,5,5,5 37 | Cape Verde,175,174,172,171,169,168,166,165,163,162,160,159,157,156,155,153,152,151 38 | Cayman Islands,7,6,6,6,6,5,5,5,5,4,4,4,4,4,4,4,4,4 39 | Central African Republic,145,161,172,184,196,209,221,237,256,277,302,327,349,364,368,363,354,345 40 | Chad,125,139,149,159,170,181,191,205,221,240,262,283,302,315,318,315,307,299 41 | Chile,38,35,33,31,29,27,25,24,22,21,19,18,17,16,15,14,13,12 42 | China,116,115,114,113,112,111,110,109,108,106,105,104,103,102,101,100,99,98 43 | Colombia,53,52,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35 44 | Comoros,85,82,79,75,72,69,67,64,61,59,56,54,52,50,48,46,44,42 45 | "Congo, Rep.",169,188,200,215,229,245,258,277,299,324,353,382,408,425,430,425,414,403 46 | Cook Islands,0,6,37,31,24,12,6,13,0,20,7,14,7,0,8,8,8,15 47 | Costa Rica,18,18,17,17,16,16,15,15,14,14,14,13,13,12,12,12,11,11 48 | Croatia,74,73,73,72,70,66,65,64,62,56,49,46,44,43,42,41,41,40 49 | Cuba,25,23,22,20,18,17,16,14,13,12,11,10,10,9,8,8,7,6 50 | Cyprus,9,9,8,8,7,7,7,7,6,6,6,6,5,5,5,5,5,5 51 | Czech Republic,21,21,21,20,20,20,20,20,19,17,15,14,13,12,11,10,10,9 52 | Cote d'Ivoire,177,196,209,224,239,255,269,289,312,338,368,398,425,444,448,443,432,420 53 | "Korea, Dem. Rep.",344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344 54 | "Congo, Dem. Rep.",165,182,195,209,222,238,251,269,290,315,343,371,396,413,417,413,402,392 55 | Denmark,15,14,14,13,12,12,11,11,10,10,9,9,9,9,8,8,8,8 56 | Djibouti,582,594,606,618,630,642,655,668,681,695,708,722,737,751,766,781,797,813 57 | Dominica,15,15,15,14,14,14,14,14,14,14,14,14,14,14,14,13,13,13 58 | Dominican Republic,114,111,108,104,101,99,96,93,90,88,85,83,80,78,76,73,71,69 59 | Ecuador,167,162,157,153,148,144,140,136,132,128,124,121,117,114,111,107,104,101 60 | Egypt,37,36,36,35,34,34,33,31,29,28,27,26,26,24,23,22,22,21 61 | El Salvador,82,79,75,72,69,66,64,61,58,56,54,51,49,47,45,43,41,40 62 | Equatorial Guinea,108,119,127,136,145,155,164,176,190,206,224,242,259,270,273,270,263,256 63 | Eritrea,72,73,74,76,77,78,79,81,82,84,85,86,88,89,91,92,94,95 64 | Estonia,32,32,35,42,48,53,58,64,66,68,66,62,55,50,46,43,40,38 65 | Ethiopia,159,176,188,201,215,229,242,260,280,304,331,358,383,399,403,398,388,378 66 | Fiji,51,48,46,43,41,39,37,35,33,32,30,28,27,26,24,23,22,21 67 | Finland,18,16,14,12,12,13,13,13,12,12,10,10,9,8,7,6,6,6 68 | France,26,25,23,22,21,20,19,19,18,17,16,16,15,15,15,14,14,14 69 | French Polynesia,34,27,45,42,47,54,43,45,51,45,29,29,29,22,26,27,30,27 70 | Gabon,153,150,148,151,156,151,166,174,200,210,254,271,285,283,296,325,366,406 71 | Gambia,185,189,193,196,200,204,208,212,217,221,225,230,234,239,244,248,253,258 72 | Georgia,39,37,39,43,47,54,62,67,73,78,82,84,84,83,83,84,84,84 73 | Germany,20,19,19,18,17,16,15,15,14,13,11,10,9,8,8,7,7,6 74 | Ghana,223,222,220,219,218,217,216,214,213,212,211,210,209,207,206,205,204,203 75 | Greece,33,32,30,28,27,26,25,24,23,22,21,20,20,19,19,18,18,18 76 | Grenada,5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4 77 | Guam,51,50,48,55,73,46,45,45,44,43,39,44,35,40,33,42,29,34 78 | Guatemala,74,74,73,72,72,71,70,70,69,68,68,67,67,66,65,65,64,63 79 | Guinea,119,126,132,139,147,154,163,171,180,190,200,211,222,234,246,259,273,287 80 | Guinea-Bissau,158,161,164,167,170,174,177,181,184,188,192,195,199,203,207,211,216,220 81 | Guyana,27,31,26,34,41,55,64,65,71,73,79,91,104,115,118,123,122,122 82 | Haiti,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306 83 | Honduras,98,95,92,89,87,84,82,80,77,75,73,71,69,67,65,63,61,59 84 | Hungary,41,42,44,46,48,48,49,47,44,40,36,33,31,28,25,22,19,17 85 | Iceland,6,6,5,5,5,5,4,4,4,4,4,3,3,2,3,3,4,4 86 | India,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168 87 | Indonesia,343,335,327,319,311,304,297,290,283,276,270,263,257,251,245,239,234,228 88 | Iran,36,37,41,39,40,40,39,35,32,31,31,30,29,27,25,24,23,22 89 | Iraq,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56 90 | Ireland,24,24,23,22,20,18,16,15,16,15,14,13,13,12,12,13,13,13 91 | Israel,14,13,13,12,11,11,11,10,10,9,9,8,8,8,8,8,8,8 92 | Italy,14,13,12,12,11,11,10,10,10,9,9,8,8,8,8,8,7,7 93 | Jamaica,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 94 | Japan,47,46,44,42,41,39,38,38,37,37,34,32,29,28,26,24,23,21 95 | Jordan,17,16,15,14,14,13,13,11,10,9,9,8,8,7,8,8,8,7 96 | Kazakhstan,58,54,54,54,55,62,72,90,111,130,141,146,148,148,144,137,133,129 97 | Kenya,112,114,135,160,192,224,258,302,344,382,405,408,419,436,441,406,371,353 98 | Kiribati,513,503,493,483,474,464,455,446,437,428,420,412,403,396,388,380,372,365 99 | Kuwait,45,42,40,37,36,34,33,32,31,29,28,27,26,25,25,24,24,24 100 | Kyrgyzstan,55,58,58,59,65,77,94,110,125,130,135,135,133,128,125,124,123,121 101 | Laos,179,177,175,173,172,170,168,167,165,163,162,160,159,157,156,154,153,151 102 | Latvia,34,36,37,41,49,60,73,82,85,85,83,83,79,73,68,63,58,53 103 | Lebanon,50,49,49,48,48,46,41,35,32,29,27,23,20,18,17,17,18,19 104 | Lesotho,184,201,218,244,280,323,362,409,461,519,553,576,613,635,643,639,638,637 105 | Liberia,199,203,207,211,215,219,223,228,232,237,242,246,251,256,261,266,272,277 106 | Libyan Arab Jamahiriya,30,29,30,29,28,28,27,25,24,23,22,22,21,20,19,18,18,17 107 | Lithuania,40,42,46,51,58,65,73,80,82,80,77,73,73,68,65,63,66,68 108 | Luxembourg,23,22,21,19,19,18,17,16,16,15,14,14,14,13,13,13,12,12 109 | Madagascar,177,181,185,189,192,196,200,205,209,213,217,222,226,231,236,241,246,251 110 | Malawi,258,286,314,343,373,390,389,401,412,417,425,414,416,410,405,391,368,346 111 | Malaysia,118,117,117,116,115,114,113,112,111,110,109,108,108,107,106,105,104,103 112 | Maldives,129,121,114,108,102,96,90,85,80,75,71,67,63,59,56,53,50,47 113 | Mali,275,277,280,282,285,287,290,292,295,297,300,303,305,308,311,313,316,319 114 | Malta,11,11,10,9,9,9,8,8,8,7,7,7,7,6,6,6,6,6 115 | Mauritania,228,232,237,241,246,251,256,261,266,272,277,282,288,294,300,305,312,318 116 | Mauritius,28,27,27,27,26,26,26,25,25,25,24,24,24,24,23,23,23,22 117 | Mexico,61,57,54,50,47,44,41,39,36,34,32,30,28,26,24,23,21,20 118 | "Micronesia, Fed. Sts.",188,181,174,168,161,155,149,143,138,133,128,123,118,114,109,105,101,97 119 | Monaco,4,4,4,4,4,3,3,3,3,3,3,3,3,2,2,2,2,2 120 | Mongolia,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205 121 | Montenegro,,,,,,,,,,,,,,,,33,32, 122 | Montserrat,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8 123 | Morocco,149,145,141,137,133,129,125,122,118,115,112,109,106,103,100,97,94,92 124 | Mozambique,181,201,214,230,245,262,276,297,320,347,378,408,436,455,460,454,443,431 125 | Myanmar,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171 126 | Namibia,322,357,381,409,435,465,491,527,568,616,671,726,776,809,817,808,787,767 127 | Nauru,85,143,140,137,45,132,129,127,124,22,44,33,55,33,110,121,132,33 128 | Nepal,243,238,233,229,224,220,216,211,207,203,199,195,191,187,184,180,176,173 129 | Netherlands,14,13,13,12,11,11,10,10,10,9,9,8,8,8,8,8,8,8 130 | Netherlands Antilles,14,13,13,12,11,11,10,10,10,9,9,8,8,8,8,8,8,7 131 | New Caledonia,93,89,87,63,57,50,58,48,48,41,49,31,32,19,29,22,22,22 132 | New Zealand,10,10,9,9,10,10,10,10,10,11,11,9,10,10,9,9,8,7 133 | Nicaragua,108,103,98,94,89,85,81,78,74,71,68,64,62,59,56,53,51,49 134 | Niger,125,127,130,133,135,138,141,143,146,149,152,155,158,161,164,168,171,174 135 | Nigeria,131,145,155,166,176,188,199,214,230,250,272,294,314,328,331,327,319,311 136 | Niue,59,58,56,55,54,53,101,0,0,57,0,0,253,0,0,0,0,0 137 | Northern Mariana Islands,71,101,150,97,93,92,94,166,167,110,121,90,80,66,75,79,69,58 138 | Norway,10,10,9,9,8,8,8,7,7,7,6,6,6,6,6,6,6,6 139 | Oman,26,23,19,16,14,14,13,13,12,12,12,13,12,12,11,12,12,13 140 | Pakistan,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181 141 | Palau,64,44,28,172,275,124,32,92,54,188,52,51,62,50,28,55,66,60 142 | Panama,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47 143 | Papua New Guinea,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250 144 | Paraguay,60,60,60,60,60,60,60,59,59,59,59,59,59,59,59,58,58,58 145 | Peru,317,301,285,270,255,242,229,217,205,195,184,174,165,156,148,140,133,126 146 | Philippines,393,386,380,373,366,360,353,347,341,335,329,323,317,312,306,301,295,290 147 | Poland,52,52,53,53,52,51,48,45,42,38,35,33,32,30,28,27,26,25 148 | Portugal,67,65,62,61,59,59,57,55,53,49,46,45,43,41,37,34,32,30 149 | Puerto Rico,11,10,11,12,12,12,11,10,9,8,7,6,5,5,5,5,4,4 150 | Qatar,60,59,59,64,72,76,71,64,63,66,66,64,60,56,57,58,64,70 151 | "Korea, Rep.",165,145,129,112,106,98,93,87,80,71,72,74,83,80,83,85,87,90 152 | Moldova,65,62,65,71,79,91,103,113,122,130,138,141,140,139,139,140,140,141 153 | Romania,74,79,86,96,105,112,116,121,125,131,136,143,145,146,140,134,125,115 154 | Russian Federation,45,42,46,51,60,73,86,94,100,106,113,112,108,105,105,106,108,110 155 | Rwanda,167,185,197,212,225,241,254,273,294,319,348,376,402,419,423,418,408,397 156 | Saint Kitts and Nevis,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9 157 | Saint Lucia,16,16,16,16,15,15,15,15,15,15,15,15,15,15,15,14,14,14 158 | Saint Vincent and the Grenadines,27,27,27,27,27,27,26,26,26,26,26,26,25,25,25,25,25,25 159 | Samoa,32,31,30,29,28,27,26,26,25,24,23,23,22,21,21,20,19,19 160 | San Marino,12,11,11,10,9,9,9,8,8,8,7,7,7,7,7,6,6,6 161 | Sao Tome and Principe,135,133,131,129,126,124,122,120,118,116,114,112,110,108,106,105,103,101 162 | Saudi Arabia,43,38,37,38,41,43,45,46,48,48,47,46,44,43,42,43,45,46 163 | Senegal,195,198,202,206,211,215,219,223,228,232,237,241,246,251,256,261,266,272 164 | Seychelles,43,43,42,41,40,40,39,38,38,37,37,36,35,35,34,33,33,32 165 | Sierra Leone,207,220,233,248,263,279,297,315,334,355,377,400,425,451,479,509,540,574 166 | Singapore,50,50,51,48,47,47,48,48,46,43,37,35,33,32,30,28,27,27 167 | Slovakia,40,41,44,45,44,41,37,35,31,29,26,25,24,22,19,17,17,17 168 | Slovenia,43,40,38,37,34,33,32,30,27,25,23,21,19,17,16,14,14,13 169 | Solomon Islands,312,296,281,267,253,240,228,216,205,195,185,175,166,158,150,142,135,128 170 | Somalia,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249 171 | South Africa,301,301,302,305,309,317,332,360,406,479,576,683,780,852,898,925,940,948 172 | Spain,56,53,50,47,45,43,41,40,38,36,35,33,33,32,31,31,30,30 173 | Sri Lanka,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60 174 | Sudan,174,178,181,185,189,192,196,200,204,208,212,216,221,225,229,234,239,243 175 | Suriname,66,61,49,51,49,51,58,67,79,83,79,79,80,86,91,100,108,116 176 | Swaziland,267,266,260,267,293,337,398,474,558,691,801,916,994,"1,075","1,127","1,141","1,169","1,198" 177 | Sweden,7,7,7,7,7,6,6,6,6,5,5,5,5,5,5,6,6,6 178 | Switzerland,18,18,16,14,14,13,12,11,11,10,9,8,8,8,8,7,7,6 179 | Syrian Arab Republic,61,57,54,51,49,46,43,41,39,37,35,33,31,29,28,26,25,24 180 | Tajikistan,112,95,66,47,51,65,82,86,97,105,117,136,153,165,181,192,211,231 181 | Thailand,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142 182 | "Macedonia, FYR",54,53,53,52,51,48,47,47,45,41,36,33,32,31,31,30,30,29 183 | Timor-Leste,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322 184 | Togo,308,314,320,326,333,339,346,353,360,367,374,382,389,397,405,413,421,429 185 | Tokelau,69,70,72,56,0,150,0,56,56,0,0,0,56,0,56,0,0,0 186 | Tonga,34,33,32,32,31,31,30,29,29,28,28,27,27,26,26,25,25,24 187 | Trinidad and Tobago,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 188 | Tunisia,31,30,31,32,33,31,31,30,28,27,25,24,23,23,24,24,25,26 189 | Turkey,49,48,47,45,43,40,40,41,41,36,31,29,28,28,28,29,29,30 190 | Turkmenistan,64,62,64,62,59,52,60,74,89,93,92,88,85,79,75,70,69,68 191 | Turks and Caicos Islands,26,24,23,22,21,20,19,18,18,17,16,15,15,15,14,14,14,14 192 | Tuvalu,296,287,277,268,259,250,242,234,226,218,211,204,197,191,184,178,172,166 193 | Uganda,163,250,272,296,306,319,314,320,326,324,340,360,386,396,385,370,350,330 194 | Ukraine,41,40,43,46,48,51,58,63,71,76,84,91,95,97,97,102,102,102 195 | United Arab Emirates,30,28,27,25,24,23,22,21,20,19,18,18,18,17,17,16,16,16 196 | United Kingdom,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,14,15,15 197 | Tanzania,178,196,213,229,249,271,290,308,317,327,339,346,352,344,337,325,311,297 198 | Virgin Islands (U.S.),19,18,17,16,15,15,14,14,13,12,12,11,11,11,11,10,10,10 199 | United States of America,9,10,10,9,9,8,7,7,6,6,6,5,5,5,5,5,4,4 200 | Uruguay,28,27,27,27,26,26,26,25,25,25,24,24,24,23,23,23,23,22 201 | Uzbekistan,68,64,63,73,73,76,72,80,85,89,93,102,110,113,113,117,115,113 202 | Vanuatu,139,134,130,125,121,117,113,109,105,102,98,95,92,89,86,83,80,77 203 | Venezuela,35,35,35,35,35,35,35,35,34,34,34,34,34,34,34,34,34,34 204 | Viet Nam,202,200,198,196,195,193,191,189,187,185,183,182,180,178,176,175,173,171 205 | Wallis et Futuna,63,176,32,87,86,47,62,107,54,53,52,7,141,111,48,52,46,15 206 | West Bank and Gaza,35,34,34,33,33,32,31,29,28,27,26,25,24,23,22,21,21,20 207 | Yemen,133,131,132,127,125,122,119,111,106,102,100,96,93,89,85,82,79,76 208 | Zambia,297,349,411,460,501,536,554,576,583,603,602,627,632,652,623,588,547,506 209 | Zimbabwe,329,364,389,417,444,474,501,538,580,628,685,740,791,825,834,824,803,782 -------------------------------------------------------------------------------- /DataSets/u.item: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/DataSets/u.item -------------------------------------------------------------------------------- /DataSets/wc_file.txt: -------------------------------------------------------------------------------- 1 | ? you are how Hi 2 | .properly strings the read to able are you Now, 3 | Why Apple Is In My Retirement Portfolio 4 | Summary 5 | Apple is a rare bird of a stock. It offers shareholders enormous growth, and could potentially become the next great dividend stock. 6 | The company is the largest &&&&&& public company in the world, surpassing Exxon Mobil. 7 | The raw fundamentals of this company are virtually incomparable. 8 | Over the last several years, I have been all over the board when it comes to Apple (AAPL). During its parabolic ------ ----- - - - - - rise in price about 2 years ago, I wrote several articles urging investors to take some chips off the table, and then when it hit some low points, I suggested it might be time to buy the stock, which I did, but not just for my growth portfolio. The stock seemed to have become a value stock with a rather strong + + + + + + dividend, so I placed it in 3 of my portfolios, and have held it ever since in 2 of the 3 portfolios I currently manage. 9 | As of several months ago, I added APPL to my newest retirement portfolio, "Buy The Dips Portfolio", or BTDP. The stock is now [ [ [ [ [ going to be held for the very long term in at least 3 out of 4 of my various portfolios, mainly for dividend income investors, but with an eye towards another strong round of growth. 10 | Apple Is More Than A Reborn Growth Stock, It Is Also A Future Dividend Champion 11 | The recent shareholder-friendly moves ] ] ] ] ] ] that Apple has made should ignite even more intense interest in the stock for both dividend-seeking investors, as well as for growth investors. -------------------------------------------------------------------------------- /Exercises/Conditional statements assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/Conditional statements assignment.pdf -------------------------------------------------------------------------------- /Exercises/Dictionary assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/Dictionary assignment.pdf -------------------------------------------------------------------------------- /Exercises/Functions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/Functions.pdf -------------------------------------------------------------------------------- /Exercises/List assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/List assignment.pdf -------------------------------------------------------------------------------- /Exercises/Loops assignment (1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/Loops assignment (1).pdf -------------------------------------------------------------------------------- /Exercises/OOPS Assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/OOPS Assignment.pdf -------------------------------------------------------------------------------- /Exercises/Python Basic- Interview/cypher.py: -------------------------------------------------------------------------------- 1 | key = {'a':'n', 'b':'o', 'c':'p', 'd':'q', 'e':'r', 'f':'s', 'g':'t', 'h':'u', 2 | 'i':'v', 'j':'w', 'k':'x', 'l':'y', 'm':'z', 'n':'a', 'o':'b', 'p':'c', 3 | 'q':'d', 'r':'e', 's':'f', 't':'g', 'u':'h', 'v':'i', 'w':'j', 'x':'k', 4 | 'y':'l', 'z':'m', 'A':'N', 'B':'O', 'C':'P', 'D':'Q', 'E':'R', 'F':'S', 5 | 'G':'T', 'H':'U', 'I':'V', 'J':'W', 'K':'X', 'L':'Y', 'M':'Z', 'N':'A', 6 | 'O':'B', 'P':'C', 'Q':'D', 'R':'E', 'S':'F', 'T':'G', 'U':'H', 'V':'I', 7 | 'W':'J', 'X':'K', 'Y':'L', 'Z':'M'} 8 | 9 | 10 | input_string = input("Enter your message: ") 11 | 12 | output_string = "" 13 | 14 | for i in input_string: 15 | if i in key.values(): 16 | output_string+=key[i] 17 | else: 18 | output_string+=i 19 | print (output_string) -------------------------------------------------------------------------------- /Exercises/Python Basic- Interview/fibonacci.py: -------------------------------------------------------------------------------- 1 | n = input("Enter n value: ") 2 | n = int(n) 3 | if(int(n)<3): 4 | while(n): 5 | print(1) 6 | n -= 1 7 | else: 8 | a,b = 1,1 9 | print(a) 10 | for i in range(int(n)-1): 11 | print (b) 12 | a,b=b,a+b 13 | -------------------------------------------------------------------------------- /Exercises/Python Basic- Interview/string_exercise.py: -------------------------------------------------------------------------------- 1 | # -*- coding: cp1252 -*- 2 | 3 | def clean(text): #passing text as argument 4 | temp1 = text 5 | try: #exception handling 6 | temp1 = text.lower().replace('\s','').replace('\t','').replace('\n','').replace("\r","").replace(".","").replace(",","").replace(".,","").replace("&","").replace("-","").replace("+","").replace("'","").replace("[","").replace("]","").strip() #coverting to lower case and replacing spaces , tabs , punctuations , special characters 7 | return temp1 8 | except: 9 | return temp1 10 | 11 | string = """Why Apple Is In My Retirement Portfolio 12 | 13 | Summary 14 | 15 | Apple is a rare bird of a stock. It offers shareholders enormous growth, and could potentially become the next great dividend stock. 16 | The company is the largest &&&&&& public company in the world, surpassing Exxon Mobil. 17 | The raw fundamentals of this company are virtually incomparable. 18 | Over the last several years, I have been all over the board when it comes to Apple (AAPL). During its parabolic ------ ----- - - - - - rise in price about 2 years ago, I wrote several articles urging investors to take some chips off the table, and then when it hit some low points, I suggested it might be time to buy the stock, which I did, but not just for my growth portfolio. The stock seemed to have become a value stock with a rather strong + + + + + + dividend, so I placed it in 3 of my portfolios, and have held it ever since in 2 of the 3 portfolios I currently manage. 19 | 20 | As of several months ago, I added APPL to my newest retirement portfolio, "Buy The Dips Portfolio", or BTDP. The stock is now [ [ [ [ [ going to be held for the very long term in at least 3 out of 4 of my various portfolios, mainly for dividend income investors, but with an eye towards another strong round of growth. 21 | 22 | Apple Is More Than A Reborn Growth Stock, It Is Also A Future Dividend Champion 23 | 24 | The recent shareholder-friendly moves ] ] ] ] ] ] that Apple has made should ignite even more intense interest in the stock for both dividend-seeking investors, as well as for growth investors. 25 | 26 | 27 | """ 28 | print (string) 29 | print ("============================================================") 30 | listA = ['apple','stock','success','growth','interest','investors','portfolio'] 31 | 32 | string_each_word_count = {} # dictionary is created 33 | listA_word_match_count = {} 34 | 35 | string_clean = clean(string) #calling 'clean' function 36 | print (string_clean) 37 | print ("============================================================") 38 | words = string_clean.split() 39 | print (words) #string is split into a list on the basis of default argument that is space 40 | print ("============================================================") 41 | sting_words_count = len(words) # len function to count length 42 | print (sting_words_count) 43 | print ("============================================================") 44 | for word in words: 45 | if word in string_each_word_count: #returns true if 'word' s there in dictionary string_each_word_count 46 | string_each_word_count[word] += 1 #increment the counter 47 | else: 48 | string_each_word_count[word] = 1 49 | print (string_each_word_count) 50 | print ("============================================================") 51 | for ele in words: 52 | ele = ele.lower() #conversion to lower case 53 | if ele in listA: 54 | if ele in listA_word_match_count: # returns true if a given key is there in the dictionary 55 | listA_word_match_count[ele] += 1 #increment the counter 56 | else: 57 | listA_word_match_count[ele] = 1 58 | 59 | print (listA_word_match_count) 60 | print ("============================================================") 61 | -------------------------------------------------------------------------------- /Exercises/Python Basic- Interview/wc.py: -------------------------------------------------------------------------------- 1 | def reverse(w): #function reverse is created with 'w' as argument 2 | length = len(w) #length of 'w' is stored in variable length 3 | s = length # 's' is assigned the value of variable of variable 'length' created above 4 | 5 | new_list = [None]*length 6 | 7 | for item in w: 8 | s = s - 1 9 | new_list[s] = item #reverse in action 10 | return new_list 11 | 12 | def word_count_dict(filename): #function is being created 13 | word_count = {} #'{}' creates a dictionary 14 | input_file = open(filename,'r') #file is opened in read mode 15 | for line in input_file: 16 | words = line.split() # creates a list , comma separated on the basis of argument , by default space 17 | reverse_words = reverse(words) #reverse function is called 18 | print (reverse_words) 19 | for word in words: 20 | word = word.lower() #coversion to lower case 21 | if not word in word_count: 22 | word_count[word] = 1 23 | else: 24 | word_count[word] = word_count[word] + 1 25 | input_file.close() # file is closed 26 | return word_count 27 | 28 | def print_words(filename): 29 | word_count = word_count_dict(filename) #function is being called 30 | words = sorted(word_count.keys()) #sort according to keys 31 | for word in words: 32 | print (word, word_count[word]) 33 | 34 | def get_count(word_count_tuple): #get_count is itself a method here,it takes word_count.items() as an argument. 35 | return word_count_tuple[1] #word_count_tuple[0] is the key and word_count_tuple[1] is the value.we want to sort by values, we use word_count_tuple[1] 36 | 37 | def print_top(filename): 38 | word_count = word_count_dict(filename) 39 | items = sorted(word_count.items(), key=get_count, reverse=True) #sort in descending order according to keys 40 | for item in items[:20]: 41 | print (item[0], item[1]) 42 | 43 | print_words('D:/UpX/DS-FoundationJan17/Week2/Assignments/Assignment1Solutions/wc_file.txt') # to print words with its count 44 | print('||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||') # to print top 20 words in count 45 | print_top('D:/UpX/DS-FoundationJan17/Week2/Assignments/Assignment1Solutions/wc_file.txt') 46 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basic Assignment/Exercise_01_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# UpX Academy - Python Basics 01\n", 8 | "## Exercise 01\n", 9 | "\n", 10 | "#### Variables\n", 11 | "\n", 12 | "###### Hello World - variable\n", 13 | "\n", 14 | " Store your own version of the message \"Hello World\" in a variable, and print it.\n", 15 | "\n", 16 | "###### One Variable, Two Messages:\n", 17 | "\n", 18 | " Store a message in a variable, and then print that message.\n", 19 | " Store a new message in the same variable, and then print that new message.\n", 20 | "\n", 21 | "###### First Name Cases\n", 22 | "\n", 23 | " Store your first name, in lowercase, in a variable.\n", 24 | " Using that one variable, print your name in lowercase, Titlecase, and UPPERCASE.\n", 25 | "\n", 26 | "###### About This Person\n", 27 | "\n", 28 | " Choose a person you look up to. Store their first and last names in separate variables.\n", 29 | " Use concatenation to make a sentence about this person, and store that sentence in a variable.-\n", 30 | " Print the sentence.\n", 31 | "\n", 32 | "###### Name Strip\n", 33 | "\n", 34 | " Store your first name in a variable, but include at least two kinds of whitespace on each side of your name.\n", 35 | " Print your name as it is stored.\n", 36 | " Print your name with whitespace stripped from the left side, then from the right side, then from both sides.\n", 37 | " \n", 38 | "\n" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": { 45 | "collapsed": true 46 | }, 47 | "outputs": [], 48 | "source": [] 49 | } 50 | ], 51 | "metadata": { 52 | "anaconda-cloud": {}, 53 | "kernelspec": { 54 | "display_name": "Python 3", 55 | "language": "python", 56 | "name": "python3" 57 | }, 58 | "language_info": { 59 | "codemirror_mode": { 60 | "name": "ipython", 61 | "version": 3 62 | }, 63 | "file_extension": ".py", 64 | "mimetype": "text/x-python", 65 | "name": "python", 66 | "nbconvert_exporter": "python", 67 | "pygments_lexer": "ipython3", 68 | "version": "3.6.5" 69 | } 70 | }, 71 | "nbformat": 4, 72 | "nbformat_minor": 1 73 | } 74 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basic Assignment/Exercise_02_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Python Basics 02\n", 8 | "## Exercise 02\n", 9 | "\n", 10 | "### Lists\n", 11 | "\n", 12 | "#### First List\n", 13 | "- Store the values 'python', 'c', and 'java' in a list. Print each of these values out, using their position in the list.\n", 14 | "\n", 15 | "#### First Neat List\n", 16 | "- Store the values 'python', 'c', and 'java' in a list. Print a statement about each of these values, using their position in the list.\n", 17 | "- Your statement could simply be, 'A nice programming language is *value*.'\n" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "metadata": { 24 | "collapsed": true 25 | }, 26 | "outputs": [], 27 | "source": [ 28 | "#YOUR CODE HERE" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "#### Working List\n", 36 | "- Make a list that includes four careers, such as 'programmer' and 'truck driver'.\n", 37 | "- Use the *list.index()* function to find the index of one career in your list.\n", 38 | "- Use the *in* function to show that this career is in your list.\n", 39 | "- Use the *append()* function to add a new career to your list.\n", 40 | "- Use the *insert()* function to add a new career at the beginning of the list.\n", 41 | "- Use a loop to show all the careers in your list." 42 | ] 43 | }, 44 | { 45 | "cell_type": "markdown", 46 | "metadata": {}, 47 | "source": [ 48 | "#### Ordered Working List\n", 49 | "- Start with the list you created in *Working List*.\n", 50 | "- You are going to print out the list in a number of different orders.\n", 51 | "- Each time you print the list, use a for loop rather than printing the raw list.\n", 52 | "- Print a message each time telling us what order we should see the list in.\n", 53 | " - Print the list in its original order.\n", 54 | " - Print the list in alphabetical order.\n", 55 | " - Print the list in reverse alphabetical order.\n", 56 | " - Print the list in the reverse order from what it started.\n", 57 | " - Permanently sort the list in alphabetical order, and then print it out.\n", 58 | " - Permanently sort the list in reverse alphabetical order, and then print it out." 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "metadata": {}, 64 | "source": [ 65 | "#### Ordered Numbers\n", 66 | "- Make a list of 5 numbers, in a random order.\n", 67 | "- You are going to print out the list in a number of different orders.\n", 68 | "- Each time you print the list, use a for loop rather than printing the raw list.\n", 69 | "- Print a message each time telling us what order we should see the list in.\n", 70 | " - Print the numbers in the original order.\n", 71 | " - Print the numbers in increasing order.\n", 72 | " - Print the numbers in decreasing order.\n", 73 | " - Print the numbers in the reverse order from how they started.\n", 74 | " - Permanently sort the numbers in increasing order, and then print them out.\n", 75 | " - Permanently sort the numbers in descreasing order, and then print them out.\n", 76 | "\n", 77 | "#### List Lengths\n", 78 | "- Copy two or three of the lists you made from the previous exercises, or make up two or three new lists.\n", 79 | "- Print out a series of statements that tell us how long each list is." 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "#### Famous People\n", 87 | "- Make a list that includes the names of four famous people.\n", 88 | "- Remove each person from the list, one at a time, using each of the four methods we have just seen:\n", 89 | " - Pop the last item from the list, and pop any item except the last item.\n", 90 | " - Remove one item by its position, and one item by its value.\n", 91 | "- Print out a message that there are no famous people left in your list, and print your list to prove that it is empty." 92 | ] 93 | }, 94 | { 95 | "cell_type": "markdown", 96 | "metadata": {}, 97 | "source": [ 98 | "#### Alphabet Slices\n", 99 | "- Store the first ten letters of the alphabet in a list.\n", 100 | "- Use a slice to print out the first three letters of the alphabet.\n", 101 | "- Use a slice to print out any three letters from the middle of your list.\n", 102 | "- Use a slice to print out the letters from any point in the middle of your list, to the end." 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "metadata": {}, 108 | "source": [ 109 | "#### Protected List\n", 110 | "- Your goal in this exercise is to prove that copying a list protects the original list.\n", 111 | "- Make a list with three people's names in it.\n", 112 | "- Use a slice to make a copy of the entire list.\n", 113 | "- Add at least two new names to the new copy of the list.\n", 114 | "- Make a loop that prints out all of the names in the original list, along with a message that this is the original list.\n", 115 | "- Make a loop that prints out all of the names in the copied list, along with a message that this is the copied list." 116 | ] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "#### First Twenty\n", 123 | "- Use the *range()* function to store the first twenty numbers (1-20) in a list, and print them out.\n", 124 | "\n", 125 | "#### Five Wallets\n", 126 | "- Imagine five wallets with different amounts of cash in them. Store these five values in a list, and print out the following sentences:\n", 127 | " - \"The fattest wallet has $ *value* in it.\"\n", 128 | " - \"The skinniest wallet has $ *value* in it.\"\n", 129 | " - \"All together, these wallets have $ *value* in them.\"" 130 | ] 131 | }, 132 | { 133 | "cell_type": "markdown", 134 | "metadata": {}, 135 | "source": [ 136 | "#### Multiples of Ten\n", 137 | "- Make a list of the first ten multiples of ten (10, 20, 30... 90, 100). There are a number of ways to do this, but try to do it using a list comprehension. Print out your list.\n", 138 | "\n", 139 | "#### Cubes\n", 140 | "- We saw how to make a list of the first ten squares. Make a list of the first ten cubes (1, 8, 27... 1000) using a list comprehension, and print them out.\n", 141 | "\n", 142 | "#### Awesomeness\n", 143 | "- Store five names in a list. Make a second list that adds the phrase \"is awesome!\" to each name, using a list comprehension. Print out the awesome version of the names.\n" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "metadata": {}, 149 | "source": [ 150 | "#### Listing a Sentence\n", 151 | "- Store a single sentence in a variable. Use a for loop to print each character from your sentence on a separate line.\n", 152 | "\n", 153 | "#### Sentence List\n", 154 | "- Store a single sentence in a variable. Create a list from your sentence. Print your raw list (don't use a loop, just print the list).\n", 155 | "\n", 156 | "#### Sentence Slices\n", 157 | "- Store a sentence in a variable. Using slices, print out the first five characters, any five consecutive characters from the middle of the sentence, and the last five characters of the sentence." 158 | ] 159 | }, 160 | { 161 | "cell_type": "markdown", 162 | "metadata": {}, 163 | "source": [ 164 | "#### Finding Python\n", 165 | "- Store a sentence in a variable, making sure you use the word *Python* at least twice in the sentence.\n", 166 | "- Use the *in* keyword to prove that the word *Python* is actually in the sentence.\n", 167 | "- Use the *find()* function to show where the word *Python* first appears in the sentence.\n", 168 | "- Use the *rfind()* function to show the last place *Python* appears in the sentence.\n", 169 | "- Use the *count()* function to show how many times the word *Python* appears in your sentence.\n", 170 | "- Use the *split()* function to break your sentence into a list of words. Print the raw list, and use a loop to print each word on its own line.\n", 171 | "- Use the *replace()* function to change *Python* to *Ruby* in your sentence." 172 | ] 173 | } 174 | ], 175 | "metadata": { 176 | "anaconda-cloud": {}, 177 | "kernelspec": { 178 | "display_name": "Python 3", 179 | "language": "python", 180 | "name": "python3" 181 | }, 182 | "language_info": { 183 | "codemirror_mode": { 184 | "name": "ipython", 185 | "version": 3 186 | }, 187 | "file_extension": ".py", 188 | "mimetype": "text/x-python", 189 | "name": "python", 190 | "nbconvert_exporter": "python", 191 | "pygments_lexer": "ipython3", 192 | "version": "3.8.8" 193 | }, 194 | "toc": { 195 | "base_numbering": 1, 196 | "nav_menu": {}, 197 | "number_sections": true, 198 | "sideBar": true, 199 | "skip_h1_title": false, 200 | "title_cell": "Table of Contents", 201 | "title_sidebar": "Contents", 202 | "toc_cell": false, 203 | "toc_position": {}, 204 | "toc_section_display": true, 205 | "toc_window_display": false 206 | } 207 | }, 208 | "nbformat": 4, 209 | "nbformat_minor": 1 210 | } 211 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basic Assignment/Exercise_03_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# Python Basics\n", 9 | "## Exercise 03\n", 10 | "\n", 11 | "### If Statements\n", 12 | "\n", 13 | "#### Three is a Crowd\n", 14 | "- Make a list of names that includes at least four people.\n", 15 | "- Write an if test that prints a message about the room being crowded, if there are more than three people in your list.\n", 16 | "- Modify your list so that there are only two people in it. Use one of the methods for removing people from the list, don't just redefine the list.\n", 17 | "- Run your if test again. There should be no output this time, because there are less than three people in the list.\n", 18 | "- **Bonus:** Store your if test in a function called something like `crowd_test`." 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 10, 24 | "metadata": {}, 25 | "outputs": [ 26 | { 27 | "name": "stdout", 28 | "output_type": "stream", 29 | "text": [ 30 | "Crowded\n", 31 | "not crowded\n" 32 | ] 33 | } 34 | ], 35 | "source": [ 36 | "names=['ram','sham','sudhir','akki']\n", 37 | "\n", 38 | "\n", 39 | "test(names)\n", 40 | "def test(names):\n", 41 | " print(\"Crowded\" if len(names)>3 else \"not crowded\")\n", 42 | "\n", 43 | "names.pop(0)\n", 44 | "names.pop(0)\n", 45 | "test(names)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "metadata": {}, 51 | "source": [ 52 | "#### Three is a Crowd - Part 2\n", 53 | "- Save your program from *Three is a Crowd* under a new name.\n", 54 | "- Add an `else` statement to your if tests. If the `else` statement is run, have it print a message that the room is not very crowded." 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": 16, 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "name": "stdout", 64 | "output_type": "stream", 65 | "text": [ 66 | " Three is a Crowd \n", 67 | "Not very Crowded\n" 68 | ] 69 | } 70 | ], 71 | "source": [ 72 | "names=['ram','sham','sudhir','akki']\n", 73 | "def crowd_test(data):\n", 74 | " print(\" Three is a Crowd \" if len(data)>3 else \"Not very Crowded\")\n", 75 | "\n", 76 | "names.append(\"lam\")\n", 77 | "names.append(\"dam\")\n", 78 | "names.append(\"tram\")\n", 79 | "\n", 80 | "crowd_test(names)\n", 81 | "names.pop()\n", 82 | "names.pop()\n", 83 | "names.pop()\n", 84 | "\n", 85 | "names.pop()\n", 86 | "\n", 87 | "names.pop()\n", 88 | "\n", 89 | "names.pop()\n", 90 | "\n", 91 | "names.pop()\n", 92 | "crowd_test(names)\n" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "metadata": {}, 98 | "source": [ 99 | "#### Six is a Mob\n", 100 | "- Save your program from *Three is a Crowd - Part 2* under a new name.\n", 101 | "- Add some names to your list, so that there are at least six people in the list.\n", 102 | "- Modify your tests so that\n", 103 | " - If there are more than 5 people, a message is printed about there being a mob in the room.\n", 104 | " - If there are 3-5 people, a message is printed about the room being crowded.\n", 105 | " - If there are 1 or 2 people, a message is printed about the room not being crowded.\n", 106 | " - If there are no people in the room, a message is printed abou the room being empty." 107 | ] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": 1, 112 | "metadata": { 113 | "collapsed": true 114 | }, 115 | "outputs": [], 116 | "source": [ 117 | "#YOUR CODE HERE" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": 17, 123 | "metadata": {}, 124 | "outputs": [ 125 | { 126 | "name": "stdout", 127 | "output_type": "stream", 128 | "text": [ 129 | " crowded\n", 130 | "no crowd\n", 131 | "empty\n" 132 | ] 133 | } 134 | ], 135 | "source": [ 136 | "def check(names):\n", 137 | " if len(names) > 5:\n", 138 | " print(\"mob\")\n", 139 | " elif len(names) >3:\n", 140 | " print(\" crowded\")\n", 141 | " elif len(names)>1:\n", 142 | " print(\"no crowd\")\n", 143 | " else:\n", 144 | " print(\"empty\")\n", 145 | " \n", 146 | "n1=['ram','sham','nam','tyam']\n", 147 | "n2=['ram','tyam']\n", 148 | "n3=[]\n", 149 | "check(n1)\n", 150 | "check(n2)\n", 151 | "check(n3)" 152 | ] 153 | } 154 | ], 155 | "metadata": { 156 | "anaconda-cloud": {}, 157 | "kernelspec": { 158 | "display_name": "Python 3", 159 | "language": "python", 160 | "name": "python3" 161 | }, 162 | "language_info": { 163 | "codemirror_mode": { 164 | "name": "ipython", 165 | "version": 3 166 | }, 167 | "file_extension": ".py", 168 | "mimetype": "text/x-python", 169 | "name": "python", 170 | "nbconvert_exporter": "python", 171 | "pygments_lexer": "ipython3", 172 | "version": "3.8.8" 173 | }, 174 | "toc": { 175 | "base_numbering": 1, 176 | "nav_menu": {}, 177 | "number_sections": true, 178 | "sideBar": true, 179 | "skip_h1_title": false, 180 | "title_cell": "Table of Contents", 181 | "title_sidebar": "Contents", 182 | "toc_cell": false, 183 | "toc_position": {}, 184 | "toc_section_display": true, 185 | "toc_window_display": false 186 | } 187 | }, 188 | "nbformat": 4, 189 | "nbformat_minor": 1 190 | } 191 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basic Assignment/Exercise_04_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# Python Basics 02\n", 9 | "## Exercise 04\n", 10 | "\n", 11 | "### Introducing Functions\n", 12 | "\n", 13 | "#### Greeter\n", 14 | "- Write a function that takes in a person's name, and prints out a greeting.\n", 15 | " - The greeting must be at least three lines, and the person's name must be in each line.\n", 16 | "- Use your function to greet at least three different people.\n", 17 | "- **Bonus:** Store your three people in a list, and call your function from a `for` loop." 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "def welcome(name):\n", 27 | " print(\"Welcome on board \"+name)\n", 28 | "# print(welcome(input(\"Enter your name\")))\n", 29 | "\n", 30 | "name=[input(\"First: \"),input(\"Second: \"),input(\"Third: \")]\n", 31 | "# name=['h','s']\n", 32 | "for i in name:\n", 33 | " welcome(i)" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": {}, 39 | "source": [ 40 | "#### Full Names\n", 41 | "- Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a sentence. Your sentence could be as simple as, \"Hello, *full\\_name*.\"\n", 42 | "- Call your function three times, with a different name each time." 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "def call():\n", 52 | " f_name=input(\"f_name\")\n", 53 | " s_name=input(\"s_name\")\n", 54 | " print(\"Hello \"+f_name+\" \"+s_name)\n", 55 | "\n", 56 | "for i in range(3):\n", 57 | " call()" 58 | ] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "metadata": {}, 63 | "source": [ 64 | "#### Addition Calculator\n", 65 | "- Write a function that takes in two numbers, and adds them together. Make your function print out a sentence showing the two numbers, and the result.\n", 66 | "- Call your function with three different sets of numbers." 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 7, 72 | "metadata": {}, 73 | "outputs": [ 74 | { 75 | "name": "stdout", 76 | "output_type": "stream", 77 | "text": [ 78 | "f_num1\n", 79 | "s_num2\n", 80 | "f numer is 1second num is2sum is: 3\n", 81 | "f_num1\n", 82 | "s_num4\n", 83 | "f numer is 1second num is4sum is: 5\n", 84 | "f_num6\n", 85 | "s_num8\n", 86 | "f numer is 6second num is8sum is: 14\n" 87 | ] 88 | } 89 | ], 90 | "source": [ 91 | "def calc(num1,num2):\n", 92 | " print(\"f numer is \"+str(num1) +\"second num is\"+str(num2) +\"sum is: \"+str(num1+num2))\n", 93 | "\n", 94 | "for i in range(0,3):\n", 95 | " num1=int(input(\"f_num\"))\n", 96 | " num2=int(input(\"s_num\"))\n", 97 | " calc(num1,num2)\n", 98 | "\n" 99 | ] 100 | }, 101 | { 102 | "cell_type": "markdown", 103 | "metadata": {}, 104 | "source": [ 105 | "#### Return Calculator\n", 106 | "- Modify *Addition Calculator* so that your function returns the sum of the two numbers. The printing should happen outside of the function." 107 | ] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": 8, 112 | "metadata": {}, 113 | "outputs": [ 114 | { 115 | "name": "stdout", 116 | "output_type": "stream", 117 | "text": [ 118 | "the result of 3 and 5 is 8\n" 119 | ] 120 | } 121 | ], 122 | "source": [ 123 | "#YOUR CODE HERE\n", 124 | "#return calculator\n", 125 | "\n", 126 | "def addition(first_number,second_number):\n", 127 | " result = first_number + second_number\n", 128 | " return result\n", 129 | " \n", 130 | " \n", 131 | "result_variable=addition(3,5)\n", 132 | "print(\"the result of 3 and 5 is %d\" %result_variable)\n" 133 | ] 134 | } 135 | ], 136 | "metadata": { 137 | "anaconda-cloud": {}, 138 | "kernelspec": { 139 | "display_name": "Python 3", 140 | "language": "python", 141 | "name": "python3" 142 | }, 143 | "language_info": { 144 | "codemirror_mode": { 145 | "name": "ipython", 146 | "version": 3 147 | }, 148 | "file_extension": ".py", 149 | "mimetype": "text/x-python", 150 | "name": "python", 151 | "nbconvert_exporter": "python", 152 | "pygments_lexer": "ipython3", 153 | "version": "3.7.4" 154 | }, 155 | "toc": { 156 | "base_numbering": 1, 157 | "nav_menu": {}, 158 | "number_sections": true, 159 | "sideBar": true, 160 | "skip_h1_title": false, 161 | "title_cell": "Table of Contents", 162 | "title_sidebar": "Contents", 163 | "toc_cell": false, 164 | "toc_position": {}, 165 | "toc_section_display": true, 166 | "toc_window_display": false 167 | } 168 | }, 169 | "nbformat": 4, 170 | "nbformat_minor": 1 171 | } 172 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basic Assignment/Exercise_05_-_Python Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Python Basics\n", 8 | "## Exercise 05\n" 9 | ] 10 | }, 11 | { 12 | "cell_type": "markdown", 13 | "metadata": {}, 14 | "source": [ 15 | "### Question 1\n", 16 | "\n", 17 | "Given the following dictionary:" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 115, 23 | "metadata": {}, 24 | "outputs": [ 25 | { 26 | "data": { 27 | "text/plain": [ 28 | "{'backpack': ['xylophone', 'dagger', 'bedroll', 'bread loaf'],\n", 29 | " 'gold': 500,\n", 30 | " 'pouch': ['flint', 'twine', 'gemstone']}" 31 | ] 32 | }, 33 | "execution_count": 115, 34 | "metadata": {}, 35 | "output_type": "execute_result" 36 | } 37 | ], 38 | "source": [ 39 | "\n", 40 | "inventory = {\n", 41 | " 'gold' : 500,\n", 42 | " 'pouch' : ['flint', 'twine', 'gemstone'],\n", 43 | " 'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']\n", 44 | "}\n", 45 | "inventory" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "metadata": {}, 51 | "source": [ 52 | "Try to do the following:\n", 53 | "\n", 54 | "Add a key to inventory called 'pocket'.\n", 55 | "\n", 56 | "Set the value of 'pocket' to be a list consisting of the strings 'seashell', 'strange berry', and 'lint'.\n", 57 | "\n", 58 | "sort()the items in the list stored under the 'backpack' key.\n", 59 | "\n", 60 | "Then .remove('dagger') from the list of items stored under the 'backpack' key.\n", 61 | "\n", 62 | "Add 50 to the number stored under the 'gold' key." 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 116, 68 | "metadata": {}, 69 | "outputs": [ 70 | { 71 | "data": { 72 | "text/plain": [ 73 | "{'backpack': ['bedroll', 'bread loaf', 'xylophone'],\n", 74 | " 'gold': 550,\n", 75 | " 'pocket': ['seashell', 'strange berry', 'lint'],\n", 76 | " 'pouch': ['flint', 'twine', 'gemstone']}" 77 | ] 78 | }, 79 | "execution_count": 116, 80 | "metadata": {}, 81 | "output_type": "execute_result" 82 | } 83 | ], 84 | "source": [ 85 | "inventory['pocket']=['seashell', 'strange berry', 'lint']\n", 86 | "inventory\n", 87 | "\n", 88 | "inventory['backpack'].sort()\n", 89 | "inventory['backpack'].remove('dagger')\n", 90 | "\n", 91 | "inventory['gold']=inventory['gold']+50\n", 92 | "\n", 93 | "inventory" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": 117, 99 | "metadata": { 100 | "collapsed": true 101 | }, 102 | "outputs": [], 103 | "source": [ 104 | "#Your Code here" 105 | ] 106 | }, 107 | { 108 | "cell_type": "markdown", 109 | "metadata": {}, 110 | "source": [ 111 | "### Question 2\n", 112 | "\n", 113 | "Folow the steps below:\n", 114 | "\n", 115 | "Create two new dictionaries called prices and stocks using {} format like the example above.\n", 116 | "\n", 117 | "Put these values in your prices dictionary:\n", 118 | "\n", 119 | "\"banana\": 4,\n", 120 | "\n", 121 | "\"apple\": 2,\n", 122 | "\n", 123 | "\"orange\": 1.5,\n", 124 | "\n", 125 | "\"pear\": 3\n", 126 | "\n", 127 | "Put these values in your stocks dictionary:\n", 128 | "\n", 129 | "\"banana\": 12,\n", 130 | "\n", 131 | "\"apple\": 24,\n", 132 | "\n", 133 | "\"orange\": 15,\n", 134 | "\n", 135 | "\"pear\": 35\n", 136 | "\n", 137 | "Loop through each key in prices.\n", 138 | "For each key, print out the key along with its price and stock information.\n", 139 | "Print the answer in the following format:\n", 140 | "\n", 141 | "apple\n", 142 | "\n", 143 | "price: 2\n", 144 | "\n", 145 | "stock: 0" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": 118, 151 | "metadata": {}, 152 | "outputs": [ 153 | { 154 | "name": "stdout", 155 | "output_type": "stream", 156 | "text": [ 157 | "banana\n", 158 | "price: 4\n", 159 | "stock: 12\n", 160 | "apple\n", 161 | "price: 2\n", 162 | "stock: 24\n", 163 | "orange\n", 164 | "price: 1.5\n", 165 | "stock: 15\n", 166 | "pear\n", 167 | "price: 3\n", 168 | "stock: 35\n" 169 | ] 170 | } 171 | ], 172 | "source": [ 173 | "#Your Code here\n", 174 | "price={\"banana\": 4,\n", 175 | "\"apple\": 2,\n", 176 | "\"orange\": 1.5,\n", 177 | "\"pear\": 3}\n", 178 | "\n", 179 | "\n", 180 | "stock={\"banana\": 12,\n", 181 | "\"apple\": 24,\n", 182 | "\"orange\": 15,\n", 183 | "\"pear\": 35}\n", 184 | "\n", 185 | "price[\"apple\"]\n", 186 | "for i in price:\n", 187 | " print(i)\n", 188 | " print(\"price: \"+str(price[i]))\n", 189 | " print(\"stock: \"+str(stock[i]))\n", 190 | " " 191 | ] 192 | }, 193 | { 194 | "cell_type": "markdown", 195 | "metadata": {}, 196 | "source": [ 197 | "Let's determine how much money you would make if you sold all of your food.\n", 198 | "\n", 199 | "Create a variable called total and set it to zero.\n", 200 | "\n", 201 | "Loop through the prices dictionaries.For each key in prices, multiply the number in prices by the number in stock.\n", 202 | "\n", 203 | "Print that value into the console and then add it to total.\n", 204 | "\n", 205 | "Finally, outside your loop, print total." 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": 119, 211 | "metadata": {}, 212 | "outputs": [ 213 | { 214 | "name": "stdout", 215 | "output_type": "stream", 216 | "text": [ 217 | "\n", 218 | "\n", 219 | "\n", 220 | "\n", 221 | "223.5\n" 222 | ] 223 | } 224 | ], 225 | "source": [ 226 | "total=0\n", 227 | "\n", 228 | "for i in price:\n", 229 | " print()\n", 230 | " total=total+(price[i]*stock[i])\n", 231 | " \n", 232 | "print(total)" 233 | ] 234 | }, 235 | { 236 | "cell_type": "markdown", 237 | "metadata": {}, 238 | "source": [ 239 | "### Question 3\n", 240 | "\n", 241 | "Follow the steps:\n", 242 | "\n", 243 | "First, make a list called groceries with the values \"banana\",\"orange\", and \"apple\".\n", 244 | "\n", 245 | "Define this two dictionaries:\n", 246 | "\n", 247 | "stock = {\n", 248 | " \"banana\": 6,\n", 249 | " \"apple\": 0,\n", 250 | " \"orange\": 32,\n", 251 | " \"pear\": 15\n", 252 | "}\n", 253 | "\n", 254 | "prices = {\n", 255 | " \"banana\": 4,\n", 256 | " \"apple\": 2,\n", 257 | " \"orange\": 1.5,\n", 258 | " \"pear\": 3\n", 259 | "}\n", 260 | "\n", 261 | "Define a function compute_bill that takes one argument food as input. \n", 262 | "In the function, create a variable total with an initial value of zero.\n", 263 | "For each item in the food list, add the price of that item to total. \n", 264 | "Finally, return the total. \n", 265 | "Ignore whether or not the item you're billing for is in stock.\n", 266 | "Note that your function should work for any food list.\n", 267 | "\n", 268 | "Make the following changes to your compute_bill function:\n", 269 | "\n", 270 | "While you loop through each item of food, only add the price of the item to total if the item's stock count is greater than zero.\n", 271 | "\n", 272 | "If the item is in stock and after you add the price to the total, subtract one from the item's stock count." 273 | ] 274 | }, 275 | { 276 | "cell_type": "code", 277 | "execution_count": 120, 278 | "metadata": { 279 | "collapsed": true 280 | }, 281 | "outputs": [], 282 | "source": [ 283 | "stock = { \"banana\": 6, \"apple\": 0, \"orange\": 32, \"pear\": 15 }\n", 284 | "prices = { \"banana\": 4, \"apple\": 2, \"orange\": 1.5, \"pear\": 3 }\n", 285 | "grocries=[\"banana\",\"orange\", \"apple\"]" 286 | ] 287 | }, 288 | { 289 | "cell_type": "code", 290 | "execution_count": 121, 291 | "metadata": {}, 292 | "outputs": [ 293 | { 294 | "data": { 295 | "text/plain": [ 296 | "7.5" 297 | ] 298 | }, 299 | "execution_count": 121, 300 | "metadata": {}, 301 | "output_type": "execute_result" 302 | } 303 | ], 304 | "source": [ 305 | "#Your Code here\n", 306 | "def compute_bill(food):\n", 307 | " total=0\n", 308 | " for i in food:\n", 309 | " total=total+prices[i]\n", 310 | " return total\n", 311 | "compute_bill(grocries)" 312 | ] 313 | }, 314 | { 315 | "cell_type": "code", 316 | "execution_count": 122, 317 | "metadata": { 318 | "collapsed": true 319 | }, 320 | "outputs": [], 321 | "source": [ 322 | "#Your Code here\n", 323 | "def compute_bill(food):\n", 324 | " total=0\n", 325 | " for i in food:\n", 326 | " if stock[i]>0:\n", 327 | " total=total+prices[i]\n", 328 | " stock[i]=stock[i]-1\n", 329 | " \n", 330 | " return total" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": 123, 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "data": { 340 | "text/plain": [ 341 | "5.5" 342 | ] 343 | }, 344 | "execution_count": 123, 345 | "metadata": {}, 346 | "output_type": "execute_result" 347 | } 348 | ], 349 | "source": [ 350 | "compute_bill(grocries)" 351 | ] 352 | }, 353 | { 354 | "cell_type": "code", 355 | "execution_count": 129, 356 | "metadata": {}, 357 | "outputs": [ 358 | { 359 | "data": { 360 | "text/plain": [ 361 | "1.5" 362 | ] 363 | }, 364 | "execution_count": 129, 365 | "metadata": {}, 366 | "output_type": "execute_result" 367 | } 368 | ], 369 | "source": [ 370 | "#After few runs\n", 371 | "compute_bill(grocries)\n" 372 | ] 373 | } 374 | ], 375 | "metadata": { 376 | "kernelspec": { 377 | "display_name": "Python 3", 378 | "language": "python", 379 | "name": "python3" 380 | }, 381 | "language_info": { 382 | "codemirror_mode": { 383 | "name": "ipython", 384 | "version": 3 385 | }, 386 | "file_extension": ".py", 387 | "mimetype": "text/x-python", 388 | "name": "python", 389 | "nbconvert_exporter": "python", 390 | "pygments_lexer": "ipython3", 391 | "version": "3.7.4" 392 | }, 393 | "toc": { 394 | "base_numbering": 1, 395 | "nav_menu": {}, 396 | "number_sections": true, 397 | "sideBar": true, 398 | "skip_h1_title": false, 399 | "title_cell": "Table of Contents", 400 | "title_sidebar": "Contents", 401 | "toc_cell": false, 402 | "toc_position": {}, 403 | "toc_section_display": true, 404 | "toc_window_display": false 405 | } 406 | }, 407 | "nbformat": 4, 408 | "nbformat_minor": 1 409 | } 410 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basics Assignments(Solved)/Exercise_01_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# AK Classes - Python Basics 01\n", 8 | "## Exercise 01\n", 9 | "\n", 10 | "#### Variables\n", 11 | "\n", 12 | "###### Hello World - variable\n", 13 | "\n", 14 | " Store your own version of the message \"Hello World\" in a variable, and print it.\n", 15 | "\n", 16 | "###### One Variable, Two Messages:\n", 17 | "\n", 18 | " Store a message in a variable, and then print that message.\n", 19 | " Store a new message in the same variable, and then print that new message.\n", 20 | "\n", 21 | "###### First Name Cases\n", 22 | "\n", 23 | " Store your first name, in lowercase, in a variable.\n", 24 | " Using that one variable, print your name in lowercase, Titlecase, and UPPERCASE.\n", 25 | "\n", 26 | "###### About This Person\n", 27 | "\n", 28 | " Choose a person you look up to. Store their first and last names in separate variables.\n", 29 | " Use concatenation to make a sentence about this person, and store that sentence in a variable.-\n", 30 | " Print the sentence.\n", 31 | "\n", 32 | "###### Name Strip\n", 33 | "\n", 34 | " Store your first name in a variable, but include at least two kinds of whitespace on each side of your name.\n", 35 | " Print your name as it is stored.\n", 36 | " Print your name with whitespace stripped from the left side, then from the right side, then from both sides.\n", 37 | " \n", 38 | "\n" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": { 45 | "collapsed": true 46 | }, 47 | "outputs": [], 48 | "source": [] 49 | } 50 | ], 51 | "metadata": { 52 | "anaconda-cloud": {}, 53 | "kernelspec": { 54 | "display_name": "Python 3", 55 | "language": "python", 56 | "name": "python3" 57 | }, 58 | "language_info": { 59 | "codemirror_mode": { 60 | "name": "ipython", 61 | "version": 3 62 | }, 63 | "file_extension": ".py", 64 | "mimetype": "text/x-python", 65 | "name": "python", 66 | "nbconvert_exporter": "python", 67 | "pygments_lexer": "ipython3", 68 | "version": "3.8.8" 69 | } 70 | }, 71 | "nbformat": 4, 72 | "nbformat_minor": 1 73 | } 74 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basics Assignments(Solved)/Exercise_01_-_Python_Basics_solved.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Python Basics 01\n", 8 | "## Exercise 01\n", 9 | "\n", 10 | "#### Variables\n", 11 | "\n", 12 | "###### Hello World - variable\n", 13 | "\n", 14 | " Store your own version of the message \"Hello World\" in a variable, and print it.\n", 15 | "\n", 16 | "###### One Variable, Two Messages:\n", 17 | "\n", 18 | " Store a message in a variable, and then print that message.\n", 19 | " Store a new message in the same variable, and then print that new message.\n", 20 | "\n", 21 | "###### First Name Cases\n", 22 | "\n", 23 | " Store your first name, in lowercase, in a variable.\n", 24 | " Using that one variable, print your name in lowercase, Titlecase, and UPPERCASE.\n", 25 | "\n", 26 | "###### About This Person\n", 27 | "\n", 28 | " Choose a person you look up to. Store their first and last names in separate variables.\n", 29 | " Use concatenation to make a sentence about this person, and store that sentence in a variable.-\n", 30 | " Print the sentence.\n", 31 | "\n", 32 | "###### Name Strip\n", 33 | "\n", 34 | " Store your first name in a variable, but include at least two kinds of whitespace on each side of your name.\n", 35 | " Print your name as it is stored.\n", 36 | " Print your name with whitespace stripped from the left side, then from the right side, then from both sides.\n", 37 | " \n", 38 | "\n" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": 15, 44 | "metadata": {}, 45 | "outputs": [ 46 | { 47 | "name": "stdout", 48 | "output_type": "stream", 49 | "text": [ 50 | "ello World\n", 51 | "Hey\n", 52 | "yeh\n", 53 | "AAYUSH\n", 54 | "aayush\n", 55 | "Aayush\n", 56 | "eon musk is founder of tesla\n", 57 | " Aayush \n", 58 | "Aayush \n", 59 | " Aayush\n" 60 | ] 61 | } 62 | ], 63 | "source": [ 64 | "#1\n", 65 | "var=\"ello World\"\n", 66 | "print(var)\n", 67 | "\n", 68 | "#2\n", 69 | "v1=\"Hey\"\n", 70 | "print(v1)\n", 71 | "v1=\"yeh\"\n", 72 | "print(v1)\n", 73 | "\n", 74 | "#3\n", 75 | "\n", 76 | "name=\"aayush\"\n", 77 | "print(name.upper())\n", 78 | "print(name.lower())\n", 79 | "print(name.title())\n", 80 | "\n", 81 | "#4\n", 82 | "first=\"eon\"\n", 83 | "last=\"musk\"\n", 84 | "sentance=first+\" \"+last+\" is founder of tesla\"\n", 85 | "print(sentance)\n", 86 | "\n", 87 | "\n", 88 | "#5\n", 89 | "name=\" Aayush \"\n", 90 | "print(name)\n", 91 | "print(name.lstrip())\n", 92 | "print(name.rstrip())\n" 93 | ] 94 | } 95 | ], 96 | "metadata": { 97 | "anaconda-cloud": {}, 98 | "kernelspec": { 99 | "display_name": "Python 3", 100 | "language": "python", 101 | "name": "python3" 102 | }, 103 | "language_info": { 104 | "codemirror_mode": { 105 | "name": "ipython", 106 | "version": 3 107 | }, 108 | "file_extension": ".py", 109 | "mimetype": "text/x-python", 110 | "name": "python", 111 | "nbconvert_exporter": "python", 112 | "pygments_lexer": "ipython3", 113 | "version": "3.8.8" 114 | }, 115 | "toc": { 116 | "base_numbering": 1, 117 | "nav_menu": {}, 118 | "number_sections": true, 119 | "sideBar": true, 120 | "skip_h1_title": false, 121 | "title_cell": "Table of Contents", 122 | "title_sidebar": "Contents", 123 | "toc_cell": false, 124 | "toc_position": {}, 125 | "toc_section_display": true, 126 | "toc_window_display": false 127 | } 128 | }, 129 | "nbformat": 4, 130 | "nbformat_minor": 1 131 | } 132 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basics Assignments(Solved)/Exercise_03_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# Python Basics\n", 9 | "## Exercise 03\n", 10 | "\n", 11 | "### If Statements\n", 12 | "\n", 13 | "#### Three is a Crowd\n", 14 | "- Make a list of names that includes at least four people.\n", 15 | "- Write an if test that prints a message about the room being crowded, if there are more than three people in your list.\n", 16 | "- Modify your list so that there are only two people in it. Use one of the methods for removing people from the list, don't just redefine the list.\n", 17 | "- Run your if test again. There should be no output this time, because there are less than three people in the list.\n", 18 | "- **Bonus:** Store your if test in a function called something like `crowd_test`." 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 22, 24 | "metadata": {}, 25 | "outputs": [ 26 | { 27 | "name": "stdout", 28 | "output_type": "stream", 29 | "text": [ 30 | "croeded\n", 31 | "['nam', 'tyam']\n", 32 | "croeded_!\n" 33 | ] 34 | } 35 | ], 36 | "source": [ 37 | "names=['ram','sham','nam','tyam']\n", 38 | "if len(names) > 3:\n", 39 | " print(\"croeded\")\n", 40 | "\n", 41 | "names.pop(1)\n", 42 | "names.remove('ram')\n", 43 | "\n", 44 | "print(names)\n", 45 | "\n", 46 | "def check(names):\n", 47 | " if len(names) > 3:\n", 48 | " print(\"croeded_!\")\n", 49 | " \n", 50 | "names1=['ram','sham','nam','tyam'] \n", 51 | "check(names1)" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 1, 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "name": "stdout", 61 | "output_type": "stream", 62 | "text": [ 63 | "The room is crowded!\n" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "#SOLUTION\n", 69 | "names_list = ['Monica','John','Ross','Joey']\n", 70 | "\n", 71 | "if len(names_list) > 3:\n", 72 | " print(\"The room is crowded!\")\n", 73 | " \n", 74 | "del names_list[2:4]\n", 75 | "\n", 76 | "if len(names_list) > 3:\n", 77 | " print(\"The room is crowded!\")\n" 78 | ] 79 | }, 80 | { 81 | "cell_type": "markdown", 82 | "metadata": {}, 83 | "source": [ 84 | "#### Three is a Crowd - Part 2\n", 85 | "- Save your program from *Three is a Crowd* under a new name.\n", 86 | "- Add an `else` statement to your if tests. If the `else` statement is run, have it print a message that the room is not very crowded." 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": 24, 92 | "metadata": {}, 93 | "outputs": [ 94 | { 95 | "name": "stdout", 96 | "output_type": "stream", 97 | "text": [ 98 | "not crowded\n" 99 | ] 100 | } 101 | ], 102 | "source": [ 103 | "def check(names):\n", 104 | " if len(names) > 3:\n", 105 | " print(\"croeded_!\")\n", 106 | " else:\n", 107 | " print(\"not crowded\")\n", 108 | " \n", 109 | "names1=['ram','sham'] \n", 110 | "check(names1)" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "metadata": { 117 | "collapsed": true 118 | }, 119 | "outputs": [], 120 | "source": [ 121 | "#solution\n", 122 | "#bonus - three is a crowd\n", 123 | "names_list = ['Monica','John','Ross','Joey']\n", 124 | "\n", 125 | "def crowd_test(list_name):\n", 126 | " if len(names_list) >3:\n", 127 | " print (\"The room is crowded!\")\n", 128 | " \n", 129 | "crowd_test(names_list)\n", 130 | "\n", 131 | "\n", 132 | "# Three is a crowd - part 2\n", 133 | "names_list = ['Monica','John','Ross','Joey']\n", 134 | "\n", 135 | "if len(names_list) < 3:\n", 136 | " print(\"The room is crowded!\")\n", 137 | " \n", 138 | "else:\n", 139 | " print (\"The room is not very crowded\")\n", 140 | " \n", 141 | "del names_list[2:4]\n", 142 | "\n", 143 | "if len(names_list) > 3:\n", 144 | " print(\"The room is crowded!\")" 145 | ] 146 | }, 147 | { 148 | "cell_type": "markdown", 149 | "metadata": {}, 150 | "source": [ 151 | "#### Six is a Mob\n", 152 | "- Save your program from *Three is a Crowd - Part 2* under a new name.\n", 153 | "- Add some names to your list, so that there are at least six people in the list.\n", 154 | "- Modify your tests so that\n", 155 | " - If there are more than 5 people, a message is printed about there being a mob in the room.\n", 156 | " - If there are 3-5 people, a message is printed about the room being crowded.\n", 157 | " - If there are 1 or 2 people, a message is printed about the room not being crowded.\n", 158 | " - If there are no people in the room, a message is printed abou the room being empty." 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "execution_count": 28, 164 | "metadata": {}, 165 | "outputs": [ 166 | { 167 | "name": "stdout", 168 | "output_type": "stream", 169 | "text": [ 170 | " crowded\n", 171 | "no crowd\n", 172 | "empty\n" 173 | ] 174 | } 175 | ], 176 | "source": [ 177 | "def check(names):\n", 178 | " if len(names) > 5:\n", 179 | " print(\"mob\")\n", 180 | " elif len(names) >3:\n", 181 | " print(\" crowded\")\n", 182 | " elif len(names)>1:\n", 183 | " print(\"no crowd\")\n", 184 | " else:\n", 185 | " print(\"empty\")\n", 186 | " \n", 187 | "n1=['ram','sham','nam','tyam']\n", 188 | "n2=['ram','tyam']\n", 189 | "n3=[]\n", 190 | "check(n1)\n", 191 | "check(n2)\n", 192 | "check(n3)" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": 20, 198 | "metadata": {}, 199 | "outputs": [ 200 | { 201 | "name": "stdout", 202 | "output_type": "stream", 203 | "text": [ 204 | "There is a mob in the room!\n", 205 | "The room is crowded\n", 206 | "The room is not crowded\n", 207 | "The room is empty\n", 208 | "OK\n", 209 | "OK\n" 210 | ] 211 | } 212 | ], 213 | "source": [ 214 | "#solution\n", 215 | "#six is a mob\n", 216 | "names_list = ['Monica','John','Ross','Joey','Chandler','Phoebe']\n", 217 | "\n", 218 | "if len(names_list) > 5 :\n", 219 | " print(\"There is a mob in the room!\")\n", 220 | "\n", 221 | "del names_list[4:5]\n", 222 | "\n", 223 | "if len(names_list) >=3 <= 5:\n", 224 | " print(\"The room is crowded\")\n", 225 | " \n", 226 | "del names_list[2:6]\n", 227 | "\n", 228 | "if len(names_list)>=1 <= 2:\n", 229 | " print(\"The room is not crowded\")\n", 230 | " \n", 231 | "del names_list[0:6]\n", 232 | "\n", 233 | "if len(names_list) ==0:\n", 234 | " print(\"The room is empty\")\n", 235 | " \n", 236 | "x=10 \n", 237 | "if x>1 & x<11:\n", 238 | " print(\"OK\")\n", 239 | "\n", 240 | "if x>1 and x<11:\n", 241 | " print(\"OK\")" 242 | ] 243 | } 244 | ], 245 | "metadata": { 246 | "anaconda-cloud": {}, 247 | "kernelspec": { 248 | "display_name": "Python 3", 249 | "language": "python", 250 | "name": "python3" 251 | }, 252 | "language_info": { 253 | "codemirror_mode": { 254 | "name": "ipython", 255 | "version": 3 256 | }, 257 | "file_extension": ".py", 258 | "mimetype": "text/x-python", 259 | "name": "python", 260 | "nbconvert_exporter": "python", 261 | "pygments_lexer": "ipython3", 262 | "version": "3.7.4" 263 | }, 264 | "toc": { 265 | "base_numbering": 1, 266 | "nav_menu": {}, 267 | "number_sections": true, 268 | "sideBar": true, 269 | "skip_h1_title": false, 270 | "title_cell": "Table of Contents", 271 | "title_sidebar": "Contents", 272 | "toc_cell": false, 273 | "toc_position": {}, 274 | "toc_section_display": true, 275 | "toc_window_display": false 276 | } 277 | }, 278 | "nbformat": 4, 279 | "nbformat_minor": 1 280 | } 281 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basics Assignments(Solved)/Exercise_04_-_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# Python Basics 02\n", 9 | "## Exercise 04\n", 10 | "\n", 11 | "### Introducing Functions\n", 12 | "\n", 13 | "#### Greeter\n", 14 | "- Write a function that takes in a person's name, and prints out a greeting.\n", 15 | " - The greeting must be at least three lines, and the person's name must be in each line.\n", 16 | "- Use your function to greet at least three different people.\n", 17 | "- **Bonus:** Store your three people in a list, and call your function from a `for` loop." 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 4, 23 | "metadata": {}, 24 | "outputs": [ 25 | { 26 | "name": "stdout", 27 | "output_type": "stream", 28 | "text": [ 29 | "welcome ram\n", 30 | "You are awesome ram\n", 31 | "ok bye ram\n", 32 | "welcome sham\n", 33 | "You are awesome sham\n", 34 | "ok bye sham\n", 35 | "welcome aayush\n", 36 | "You are awesome aayush\n", 37 | "ok bye aayush\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "def greeting(name):\n", 43 | " print(\"welcome \" + str(name))\n", 44 | " print(\"You are awesome \" + str(name))\n", 45 | " print(\"ok bye \" + str(name))\n", 46 | "\n", 47 | "#greeting(\"Aayush\")\n", 48 | "\n", 49 | "name=['ram','sham','aayush']\n", 50 | "\n", 51 | "for i in name:\n", 52 | " greeting(i)" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": 8, 58 | "metadata": { 59 | "scrolled": false 60 | }, 61 | "outputs": [ 62 | { 63 | "name": "stdout", 64 | "output_type": "stream", 65 | "text": [ 66 | "Hello Adam!\n", 67 | "Wish you a great day ahead, Adam.\n", 68 | "Adam, how can I help you?\n", 69 | "Hello Usashi!\n", 70 | "Wish you a great day ahead, Usashi.\n", 71 | "Usashi, how can I help you?\n", 72 | "Hello John!\n", 73 | "Wish you a great day ahead, John.\n", 74 | "John, how can I help you?\n", 75 | "Hello Adam!\n", 76 | "Wish you a great day ahead, Adam.\n", 77 | "Adam, how can I help you?\n", 78 | "Hello Usashi!\n", 79 | "Wish you a great day ahead, Usashi.\n", 80 | "Usashi, how can I help you?\n", 81 | "Hello John!\n", 82 | "Wish you a great day ahead, John.\n", 83 | "John, how can I help you?\n" 84 | ] 85 | } 86 | ], 87 | "source": [ 88 | "#Solution\n", 89 | "#Greeter solution\n", 90 | "\n", 91 | "def greeter(person_name):\n", 92 | " print(\"Hello %s!\" % person_name)\n", 93 | " print(\"Wish you a great day ahead, %s.\" % person_name)\n", 94 | " print(\"%s, how can I help you?\"% person_name )\n", 95 | " \n", 96 | "greeter('Adam')\n", 97 | "greeter('Usashi')\n", 98 | "greeter('John')\n", 99 | "\n", 100 | "\n", 101 | "#greeter bonus solution\n", 102 | "\n", 103 | "names =['Adam','Usashi','John']\n", 104 | "\n", 105 | "def greeter(person_name):\n", 106 | " print(\"Hello %s!\" % person_name)\n", 107 | " print(\"Wish you a great day ahead, %s.\" % person_name)\n", 108 | " print(\"%s, how can I help you?\"% person_name )\n", 109 | " \n", 110 | "for name in names:\n", 111 | " greeter(name)" 112 | ] 113 | }, 114 | { 115 | "cell_type": "markdown", 116 | "metadata": {}, 117 | "source": [ 118 | "#### Full Names\n", 119 | "- Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a sentence. Your sentence could be as simple as, \"Hello, *full\\_name*.\"\n", 120 | "- Call your function three times, with a different name each time." 121 | ] 122 | }, 123 | { 124 | "cell_type": "code", 125 | "execution_count": 5, 126 | "metadata": {}, 127 | "outputs": [ 128 | { 129 | "name": "stdout", 130 | "output_type": "stream", 131 | "text": [ 132 | "Hello, Aayush Kubba\n" 133 | ] 134 | } 135 | ], 136 | "source": [ 137 | "def name(f,l):\n", 138 | " print(\"Hello, \"+f+\" \"+l)\n", 139 | " \n", 140 | "name(\"Aayush\",\"Kubba\")\n", 141 | "\n", 142 | "\n" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": 9, 148 | "metadata": {}, 149 | "outputs": [ 150 | { 151 | "name": "stdout", 152 | "output_type": "stream", 153 | "text": [ 154 | "Hello Nigrah Bamb.\n", 155 | "Hello Vipul Tiwari.\n", 156 | "Hello Farha khan.\n" 157 | ] 158 | } 159 | ], 160 | "source": [ 161 | "#SOLUTION\n", 162 | "#Full names solution\n", 163 | "\n", 164 | "def full_name(first_name,second_name):\n", 165 | " #to use %s two times :\n", 166 | " print(\"Hello %s %s.\" %(first_name,second_name))\n", 167 | " \n", 168 | "full_name('Nigrah','Bamb')\n", 169 | "full_name('Vipul','Tiwari')\n", 170 | "full_name('Farha','khan')" 171 | ] 172 | }, 173 | { 174 | "cell_type": "markdown", 175 | "metadata": {}, 176 | "source": [ 177 | "#### Addition Calculator\n", 178 | "- Write a function that takes in two numbers, and adds them together. Make your function print out a sentence showing the two numbers, and the result.\n", 179 | "- Call your function with three different sets of numbers." 180 | ] 181 | }, 182 | { 183 | "cell_type": "code", 184 | "execution_count": 13, 185 | "metadata": {}, 186 | "outputs": [ 187 | { 188 | "name": "stdout", 189 | "output_type": "stream", 190 | "text": [ 191 | "3\n", 192 | "6\n", 193 | "15\n" 194 | ] 195 | } 196 | ], 197 | "source": [ 198 | "def sums(n1,n2):\n", 199 | " print(n1+n2)\n", 200 | " \n", 201 | "sums(1,2)\n", 202 | "sums(2,4)\n", 203 | "sums(7,8)" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": null, 209 | "metadata": { 210 | "collapsed": true 211 | }, 212 | "outputs": [], 213 | "source": [ 214 | "\n", 215 | "#SOLUTION\n", 216 | "\n", 217 | "#addition\n", 218 | "\n", 219 | "def addition(first_number,second_number):\n", 220 | " result = first_number + second_number\n", 221 | " print(\"The addition of %d and %d is %d\" %(first_number,second_number,result))\n", 222 | " \n", 223 | "addition(3,5)\n", 224 | "addition(2,7)\n", 225 | "addition(1,5)\n" 226 | ] 227 | }, 228 | { 229 | "cell_type": "markdown", 230 | "metadata": {}, 231 | "source": [ 232 | "#### Return Calculator\n", 233 | "- Modify *Addition Calculator* so that your function returns the sum of the two numbers. The printing should happen outside of the function." 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": 14, 239 | "metadata": {}, 240 | "outputs": [ 241 | { 242 | "name": "stdout", 243 | "output_type": "stream", 244 | "text": [ 245 | "3\n" 246 | ] 247 | } 248 | ], 249 | "source": [ 250 | "def sums(n1,n2):\n", 251 | " return (n1+n2)\n", 252 | "\n", 253 | "x=sums(1,2)\n", 254 | "print(x)" 255 | ] 256 | }, 257 | { 258 | "cell_type": "code", 259 | "execution_count": 2, 260 | "metadata": {}, 261 | "outputs": [ 262 | { 263 | "name": "stdout", 264 | "output_type": "stream", 265 | "text": [ 266 | "the result of 3 and 5 is 8\n" 267 | ] 268 | } 269 | ], 270 | "source": [ 271 | "#return calculator\n", 272 | "\n", 273 | "def addition(first_number,second_number):\n", 274 | " result = first_number + second_number\n", 275 | " return result\n", 276 | " \n", 277 | " \n", 278 | "result_variable=addition(3,5)\n", 279 | "print(\"the result of 3 and 5 is %d\" %result_variable)\n" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": null, 285 | "metadata": { 286 | "collapsed": true 287 | }, 288 | "outputs": [], 289 | "source": [] 290 | } 291 | ], 292 | "metadata": { 293 | "anaconda-cloud": {}, 294 | "kernelspec": { 295 | "display_name": "Python 3", 296 | "language": "python", 297 | "name": "python3" 298 | }, 299 | "language_info": { 300 | "codemirror_mode": { 301 | "name": "ipython", 302 | "version": 3 303 | }, 304 | "file_extension": ".py", 305 | "mimetype": "text/x-python", 306 | "name": "python", 307 | "nbconvert_exporter": "python", 308 | "pygments_lexer": "ipython3", 309 | "version": "3.8.8" 310 | }, 311 | "toc": { 312 | "base_numbering": 1, 313 | "nav_menu": {}, 314 | "number_sections": true, 315 | "sideBar": true, 316 | "skip_h1_title": false, 317 | "title_cell": "Table of Contents", 318 | "title_sidebar": "Contents", 319 | "toc_cell": false, 320 | "toc_position": {}, 321 | "toc_section_display": true, 322 | "toc_window_display": false 323 | } 324 | }, 325 | "nbformat": 4, 326 | "nbformat_minor": 1 327 | } 328 | -------------------------------------------------------------------------------- /Exercises/Python Basics/Python Basics Assignments(Solved)/Exercise_05_-_Python Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Python Basics\n", 8 | "## Exercise 05\n" 9 | ] 10 | }, 11 | { 12 | "cell_type": "markdown", 13 | "metadata": {}, 14 | "source": [ 15 | "### Question 1\n", 16 | "\n", 17 | "Given the following dictionary:" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 18, 23 | "metadata": { 24 | "collapsed": true 25 | }, 26 | "outputs": [], 27 | "source": [ 28 | "\n", 29 | "inventory = {\n", 30 | " 'gold' : 500,\n", 31 | " 'pouch' : ['flint', 'twine', 'gemstone'],\n", 32 | " 'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']\n", 33 | "}" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": {}, 39 | "source": [ 40 | "Try to do the following:\n", 41 | "\n", 42 | "Add a key to inventory called 'pocket'.\n", 43 | "\n", 44 | "Set the value of 'pocket' to be a list consisting of the strings 'seashell', 'strange berry', and 'lint'.\n", 45 | "\n", 46 | "sort()the items in the list stored under the 'backpack' key.\n", 47 | "\n", 48 | "Then .remove('dagger') from the list of items stored under the 'backpack' key.\n", 49 | "\n", 50 | "Add 50 to the number stored under the 'gold' key." 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 19, 56 | "metadata": {}, 57 | "outputs": [ 58 | { 59 | "name": "stdout", 60 | "output_type": "stream", 61 | "text": [ 62 | "{'gold': 500, 'backpack': ['xylophone', 'dagger', 'bedroll', 'bread loaf'], 'pouch': ['flint', 'twine', 'gemstone']}\n", 63 | "dict_keys(['gold', 'backpack', 'pouch'])\n", 64 | "\n", 65 | "['xylophone', 'dagger', 'bedroll', 'bread loaf']\n", 66 | "orginal:\n", 67 | "{'gold': 500, 'pocket': ['seashell', 'strange berry', 'lint'], 'backpack': ['xylophone', 'dagger', 'bedroll', 'bread loaf'], 'pouch': ['flint', 'twine', 'gemstone']}\n", 68 | "new:\n", 69 | "{'gold': 500, 'pocket': ['seashell', 'strange berry', 'lint'], 'backpack': ['bedroll', 'bread loaf', 'dagger', 'xylophone'], 'pouch': ['flint', 'twine', 'gemstone']}\n", 70 | "['bedroll', 'bread loaf', 'xylophone']\n", 71 | "50\n" 72 | ] 73 | } 74 | ], 75 | "source": [ 76 | "inventory = {\n", 77 | " 'gold' : 500,\n", 78 | " 'pouch' : ['flint', 'twine', 'gemstone'],\n", 79 | " 'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']\n", 80 | "}\n", 81 | "print(inventory)\n", 82 | "print(inventory.keys())\n", 83 | "#help(inventory.update)\n", 84 | "inventory.update({'pocket': ['seashell','strange berry','lint']})\n", 85 | "\n", 86 | "print()\n", 87 | "print(inventory['backpack'])\n", 88 | "\n", 89 | "print(\"orginal:\")\n", 90 | "print(inventory)\n", 91 | "sorted(inventory['backpack'])#this won't sort\n", 92 | "print(\"new:\")\n", 93 | "inventory['backpack'].sort()\n", 94 | "print(inventory)\n", 95 | "inventory['backpack'].remove('dagger')\n", 96 | "print(inventory['backpack'])\n", 97 | "\n", 98 | "inventory['gold']=50\n", 99 | "\n", 100 | "print(inventory['gold'])" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 20, 106 | "metadata": {}, 107 | "outputs": [ 108 | { 109 | "name": "stdout", 110 | "output_type": "stream", 111 | "text": [ 112 | "{'gold': 550, 'pocket': ['seashell', 'strange berry', 'lint'], 'backpack': ['bedroll', 'bread loaf', 'xylophone'], 'pouch': ['flint', 'twine', 'gemstone']}\n" 113 | ] 114 | }, 115 | { 116 | "data": { 117 | "text/plain": [ 118 | "{'backpack': ['bedroll', 'bread loaf', 'xylophone'],\n", 119 | " 'gold': 550,\n", 120 | " 'pocket': ['seashell', 'strange berry', 'lint'],\n", 121 | " 'pouch': ['flint', 'twine', 'gemstone']}" 122 | ] 123 | }, 124 | "execution_count": 20, 125 | "metadata": {}, 126 | "output_type": "execute_result" 127 | } 128 | ], 129 | "source": [ 130 | "#SOLUTION\n", 131 | "#Your Code here\n", 132 | "inventory = {\n", 133 | " 'gold' : 500,\n", 134 | " 'pouch' : ['flint', 'twine', 'gemstone'],\n", 135 | " 'backpack' : ['xylophone','dagger', 'bedroll','bread loaf']\n", 136 | "}\n", 137 | "inventory['pocket']=['seashell', 'strange berry', 'lint']\n", 138 | "inventory['backpack'].sort()\n", 139 | "inventory['backpack'].remove('dagger')\n", 140 | "\n", 141 | "inventory['gold']=inventory['gold']+50\n", 142 | "print (inventory)\n", 143 | "{'pocket': ['seashell', 'strange berry', 'lint'], 'backpack': ['bedroll', 'bread loaf', 'xylophone'], 'pouch': ['flint', 'twine', 'gemstone'], 'gold': 550}\n" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "metadata": {}, 149 | "source": [ 150 | "### Question 2\n", 151 | "\n", 152 | "Folow the steps below:\n", 153 | "\n", 154 | "Create two new dictionaries called prices and stocks using {} format like the example above.\n", 155 | "\n", 156 | "Put these values in your prices dictionary:\n", 157 | "\n", 158 | "\"banana\": 4,\n", 159 | "\n", 160 | "\"apple\": 2,\n", 161 | "\n", 162 | "\"orange\": 1.5,\n", 163 | "\n", 164 | "\"pear\": 3\n", 165 | "\n", 166 | "Put these values in your stocks dictionary:\n", 167 | "\n", 168 | "\"banana\": 12,\n", 169 | "\n", 170 | "\"apple\": 24,\n", 171 | "\n", 172 | "\"orange\": 15,\n", 173 | "\n", 174 | "\"pear\": 35\n", 175 | "\n", 176 | "Loop through each key in prices.\n", 177 | "For each key, print out the key along with its price and stock information.\n", 178 | "Print the answer in the following format:\n", 179 | "\n", 180 | "apple\n", 181 | "\n", 182 | "price: 2\n", 183 | "\n", 184 | "stock: 0\n", 185 | "\n", 186 | "Let's determine how much money you would make if you sold all of your food.\n", 187 | "\n", 188 | "Create a variable called total and set it to zero.\n", 189 | "\n", 190 | "Loop through the prices dictionaries.For each key in prices, multiply the number in prices by the number in stock.\n", 191 | "\n", 192 | "Print that value into the console and then add it to total.\n", 193 | "\n", 194 | "Finally, outside your loop, print total." 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": 21, 200 | "metadata": {}, 201 | "outputs": [ 202 | { 203 | "name": "stdout", 204 | "output_type": "stream", 205 | "text": [ 206 | "{'orange': 1.5, 'banana': 4, 'apple': 2, 'pear': 3}\n", 207 | "22.5\n", 208 | "48\n", 209 | "48\n", 210 | "105\n", 211 | "223.5\n" 212 | ] 213 | } 214 | ], 215 | "source": [ 216 | "prices = {\n", 217 | "\"banana\": 4,\n", 218 | "\"apple\": 2,\n", 219 | "\"orange\": 1.5,\n", 220 | "\"pear\": 3\n", 221 | "}\n", 222 | "\n", 223 | "print(prices)\n", 224 | "\n", 225 | "\n", 226 | "stocks={\"banana\": 12,\n", 227 | "\n", 228 | "\"apple\": 24,\n", 229 | "\n", 230 | "\"orange\": 15,\n", 231 | "\n", 232 | "\"pear\": 35}\n", 233 | "\n", 234 | "total=0\n", 235 | "\n", 236 | "for i in prices:\n", 237 | " print(stocks.get(i)*prices.get(i))\n", 238 | " total = total+ stocks.get(i)*prices.get(i)\n", 239 | "print(total)" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 22, 245 | "metadata": {}, 246 | "outputs": [ 247 | { 248 | "name": "stdout", 249 | "output_type": "stream", 250 | "text": [ 251 | "orange\n", 252 | "price: 1.5\n", 253 | "stock: 32\n", 254 | "banana\n", 255 | "price: 4\n", 256 | "stock: 6\n", 257 | "apple\n", 258 | "price: 2\n", 259 | "stock: 0\n", 260 | "pear\n", 261 | "price: 3\n", 262 | "stock: 15\n", 263 | "48.0\n", 264 | "24\n", 265 | "0\n", 266 | "45\n", 267 | "The total money is 117.0\n" 268 | ] 269 | } 270 | ], 271 | "source": [ 272 | "#SOLUTION\n", 273 | "#Your Code here\n", 274 | "#Create the prices dictionary:\n", 275 | "prices={}\n", 276 | "#Add values\n", 277 | "prices[\"banana\"]=4\n", 278 | "prices[\"apple\"]= 2\n", 279 | "prices[\"orange\"]= 1.5\n", 280 | "prices[\"pear\"]= 3\n", 281 | "#Create the stock dictionary\n", 282 | "stock={}\n", 283 | "#Add values\n", 284 | "stock[\"banana\"]= 6\n", 285 | "stock[\"apple\"]= 0\n", 286 | "stock[\"orange\"] =32\n", 287 | "stock[\"pear\"]= 15\n", 288 | "#Show all prices and stock\n", 289 | "for food in prices:\n", 290 | " print (food)\n", 291 | " print (\"price: %s\" % prices[food])\n", 292 | " print (\"stock: %s\" % stock[food])\n", 293 | "total=0\n", 294 | "for price in prices:\n", 295 | " money= prices[price]*stock[price]\n", 296 | " print(money)\n", 297 | " total=total +money\n", 298 | "print(\"The total money is\", total)" 299 | ] 300 | }, 301 | { 302 | "cell_type": "markdown", 303 | "metadata": {}, 304 | "source": [ 305 | "### Question 3\n", 306 | "\n", 307 | "Follow the steps:\n", 308 | "\n", 309 | "First, make a list called groceries with the values \"banana\",\"orange\", and \"apple\".\n", 310 | "\n", 311 | "Define this two dictionaries:\n", 312 | "\n", 313 | "stock = {\n", 314 | " \"banana\": 6,\n", 315 | " \"apple\": 0,\n", 316 | " \"orange\": 32,\n", 317 | " \"pear\": 15\n", 318 | "}\n", 319 | "\n", 320 | "prices = {\n", 321 | " \"banana\": 4,\n", 322 | " \"apple\": 2,\n", 323 | " \"orange\": 1.5,\n", 324 | " \"pear\": 3\n", 325 | "}\n", 326 | "\n", 327 | "Define a function compute_bill that takes one argument food as input. \n", 328 | "In the function, create a variable total with an initial value of zero.\n", 329 | "For each item in the food list, add the price of that item to total. \n", 330 | "Finally, return the total. \n", 331 | "Ignore whether or not the item you're billing for is in stock.\n", 332 | "Note that your function should work for any food list.\n", 333 | "\n", 334 | "Make the following changes to your compute_bill function:\n", 335 | "\n", 336 | "While you loop through each item of food, only add the price of the item to total if the item's stock count is greater than zero.\n", 337 | "\n", 338 | "If the item is in stock and after you add the price to the total, subtract one from the item's stock count." 339 | ] 340 | }, 341 | { 342 | "cell_type": "code", 343 | "execution_count": 23, 344 | "metadata": {}, 345 | "outputs": [ 346 | { 347 | "name": "stdout", 348 | "output_type": "stream", 349 | "text": [ 350 | "i banana\n", 351 | "5\n", 352 | "i orange\n", 353 | "31\n", 354 | "i apple\n", 355 | "no stock\n", 356 | "5.5\n" 357 | ] 358 | } 359 | ], 360 | "source": [ 361 | "groceries=[\"banana\",\"orange\",\"apple\"]\n", 362 | "stock = { \"banana\": 6, \"apple\": 0, \"orange\": 32, \"pear\": 15 }\n", 363 | "prices = { \"banana\": 4, \"apple\": 2, \"orange\": 1.5, \"pear\": 3 }\n", 364 | "\n", 365 | "\n", 366 | "\n", 367 | "def compute_bill(food):\n", 368 | " total=0\n", 369 | " for i in food:\n", 370 | " print(\"i \" +str(i))\n", 371 | " if stock.get(i) >= 1:\n", 372 | " total=total+prices.get(i)\n", 373 | " stock[i]= stock[i]- 1\n", 374 | " print(stock[i])\n", 375 | " else:\n", 376 | " print(\"no stock\")\n", 377 | " return total\n", 378 | " \n", 379 | "total=compute_bill(groceries)\n", 380 | "#compute_bill(groceries)\n", 381 | "#compute_bill(groceries)\n", 382 | "print(total)" 383 | ] 384 | }, 385 | { 386 | "cell_type": "code", 387 | "execution_count": 24, 388 | "metadata": {}, 389 | "outputs": [ 390 | { 391 | "name": "stdout", 392 | "output_type": "stream", 393 | "text": [ 394 | "5.5\n" 395 | ] 396 | } 397 | ], 398 | "source": [ 399 | "#SOLUTION\n", 400 | "#Your Code here\n", 401 | "shopping_list = [\"banana\", \"orange\", \"apple\"]\n", 402 | "\n", 403 | "stock = {\n", 404 | " \"banana\": 6,\n", 405 | " \"apple\": 0,\n", 406 | " \"orange\": 32,\n", 407 | " \"pear\": 15\n", 408 | "}\n", 409 | "\n", 410 | "prices = {\n", 411 | " \"banana\": 4,\n", 412 | " \"apple\": 2,\n", 413 | " \"orange\": 1.5,\n", 414 | " \"pear\": 3\n", 415 | "}\n", 416 | "\n", 417 | "\n", 418 | "def compute_bill(food):\n", 419 | " total=0\n", 420 | " for x in food:\n", 421 | " price= prices[x]\n", 422 | " if stock[x]>0:\n", 423 | " total=total +price\n", 424 | " stock[x]=stock[x] -1\n", 425 | " print (total)\n", 426 | "\n", 427 | "compute_bill(shopping_list)\n" 428 | ] 429 | }, 430 | { 431 | "cell_type": "code", 432 | "execution_count": null, 433 | "metadata": { 434 | "collapsed": true 435 | }, 436 | "outputs": [], 437 | "source": [] 438 | } 439 | ], 440 | "metadata": { 441 | "anaconda-cloud": {}, 442 | "kernelspec": { 443 | "display_name": "Python 3", 444 | "language": "python", 445 | "name": "python3" 446 | }, 447 | "language_info": { 448 | "codemirror_mode": { 449 | "name": "ipython", 450 | "version": 3 451 | }, 452 | "file_extension": ".py", 453 | "mimetype": "text/x-python", 454 | "name": "python", 455 | "nbconvert_exporter": "python", 456 | "pygments_lexer": "ipython3", 457 | "version": "3.8.8" 458 | }, 459 | "toc": { 460 | "base_numbering": 1, 461 | "nav_menu": {}, 462 | "number_sections": true, 463 | "sideBar": true, 464 | "skip_h1_title": false, 465 | "title_cell": "Table of Contents", 466 | "title_sidebar": "Contents", 467 | "toc_cell": false, 468 | "toc_position": {}, 469 | "toc_section_display": true, 470 | "toc_window_display": false 471 | } 472 | }, 473 | "nbformat": 4, 474 | "nbformat_minor": 1 475 | } 476 | -------------------------------------------------------------------------------- /Exercises/String assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/String assignment.pdf -------------------------------------------------------------------------------- /Exercises/Tuple and set assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Exercises/Tuple and set assignment.pdf -------------------------------------------------------------------------------- /Installation-Guide.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Installation-Guide.docx -------------------------------------------------------------------------------- /Python_basics_practice_exercise.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1) Write a program to generate a Fibonacci series 4 | 5 | 2) In cryptography, a Caesar cipher is a very simple encryption techniques in which each letter in the plain text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 3, A would be replaced by D, B would become E, and so on. The method is named after Julius Caesar, who used it to communicate with his generals. ROT-13 ("rotate by 13 places") is a widely used example of a Caesar cipher where the shift is 13. In Python, the key for ROT-13 may be represented by means of the following dictionary: 6 | key = {'a':'n', 'b':'o', 'c':'p', 'd':'q', 'e':'r', 'f':'s', 'g':'t', 'h':'u', 7 | 'i':'v', 'j':'w', 'k':'x', 'l':'y', 'm':'z', 'n':'a', 'o':'b', 'p':'c', 8 | 'q':'d', 'r':'e', 's':'f', 't':'g', 'u':'h', 'v':'i', 'w':'j', 'x':'k', 9 | 'y':'l', 'z':'m', 'A':'N', 'B':'O', 'C':'P', 'D':'Q', 'E':'R', 'F':'S', 10 | 'G':'T', 'H':'U', 'I':'V', 'J':'W', 'K':'X', 'L':'Y', 'M':'Z', 'N':'A', 11 | 'O':'B', 'P':'C', 'Q':'D', 'R':'E', 'S':'F', 'T':'G', 'U':'H', 'V':'I', 12 | 'W':'J', 'X':'K', 'Y':'L', 'Z':'M'} 13 | Your task in this exercise is to implement an encoder/decoder of ROT-13. Once you're done, you will be able to read the following secret message: 14 | Pnrfne pvcure zrgubq vf anzrq nsgre Whyvhf Pnrfne! 15 | Note that since English has 26 characters, your ROT-13 program will be able to both encode and decode texts written in English. 16 | 17 | 3) You are given a string of text. Clean the text to remove for any punctuations, extra white spaces, tab characters and count the number of words within the text. After this, count the unique number of words in a text and the frequency of occurrence of each word in that text. Finally, you are provided a dictionary. Using the dictionary, count the words and frequency of words in the dictionary that occur in text. 18 | Why Apple Is In My Retirement Portfolio 19 | Summary 20 | Apple is a rare bird of a stock. It offers shareholders enormous growth, and could potentially become the next great dividend stock. 21 | The company is the largest &&&&&& public company in the world, surpassing Exxon Mobil. 22 | The raw fundamentals of this company are virtually incomparable. 23 | Over the last several years, I have been all over the board when it comes to Apple (AAPL). During its parabolic ------ ----- - - - - - rise in price about 2 years ago, I wrote several articles urging investors to take some chips off the table, and then when it hit some low points, I suggested it might be time to buy the stock, which I did, but not just for my growth portfolio. The stock seemed to have become a value stock with a rather strong + + + + + + dividend, so I placed it in 3 of my portfolios, and have held it ever since in 2 of the 3 portfolios I currently manage. 24 | As of several months ago, I added APPL to my newest retirement portfolio, "Buy The Dips Portfolio", or BTDP. The stock is now [ [ [ [ [ going to be held for the very long term in at least 3 out of 4 of my various portfolios, mainly for dividend income investors, but with an eye towards another strong round of growth. 25 | Apple Is More Than A Reborn Growth Stock, It Is Also A Future Dividend Champion 26 | The recent shareholder-friendly moves ] ] ] ] ] ] that Apple has made should ignite even more intense interest in the stock for both dividend-seeking investors, as well as for growth investors. 27 | 28 | 4) Write a python program which reads a text file and performs the following operations: 29 | a) Arrange the words in every line in reverse order and print them 30 | b) Count the frequency of each word in the file and print them in alphabetical order (by words). The output should have word followed by its frequency count. Convert all the words in the file into lowercase to avoid duplication of words. 31 | c) Print top 20 most frequently used words 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python_Tutorial 2 | Open-Sourcing all of my python tutorials. 3 | 4 | ## Numpy 5 | https://www.machinelearningplus.com/python/101-numpy-exercises-python/ 6 | 7 | ## Pandas 8 | https://www.machinelearningplus.com/python/101-pandas-exercises-python/ 9 | 10 | 11 | Blog post on Python basics: 12 | https://medium.com/@darshitakumar01/python-tutorial-for-beginners-a3404d397fb4 13 | 14 | ## Practice Python 15 | https://www.practicepython.org/ 16 | 17 | https://www.w3resource.com/python-exercises/ 18 | 19 | https://pynative.com/python-basic-exercise-for-beginners/ 20 | -------------------------------------------------------------------------------- /Tutorial Reference Slides/ConditionalStatements.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/ConditionalStatements.pptx -------------------------------------------------------------------------------- /Tutorial Reference Slides/ControlStatements.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/ControlStatements.pptx -------------------------------------------------------------------------------- /Tutorial Reference Slides/PYTHON- OBJECT ORIENTED PROGRAMMING.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/PYTHON- OBJECT ORIENTED PROGRAMMING.pdf -------------------------------------------------------------------------------- /Tutorial Reference Slides/Python Sets.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/Python Sets.pptx -------------------------------------------------------------------------------- /Tutorial Reference Slides/lists in python.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/lists in python.pptx -------------------------------------------------------------------------------- /Tutorial Reference Slides/python-tuple.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/Tutorial Reference Slides/python-tuple.pptx -------------------------------------------------------------------------------- /python-cheatsheet/Bokeh-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Bokeh-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Data Wrangling-Pandas_Cheat_Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Data Wrangling-Pandas_Cheat_Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Jupyter Notebook-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Jupyter Notebook-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Keras-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Keras-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Matplotlib-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Matplotlib-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Numpy Basics-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Numpy Basics-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Pandas Basic-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Pandas Basic-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Pandas Cheat Sheet Data Wrangling in Python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Pandas Cheat Sheet Data Wrangling in Python.png -------------------------------------------------------------------------------- /python-cheatsheet/PySpark - RDD Basics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/PySpark - RDD Basics.pdf -------------------------------------------------------------------------------- /python-cheatsheet/PySpark-SQL Baiscs -Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/PySpark-SQL Baiscs -Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Python Basics-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Python Basics-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/PythonForDataScience.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/PythonForDataScience.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Python_Tutorial__1621540958.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Python_Tutorial__1621540958.pdf -------------------------------------------------------------------------------- /python-cheatsheet/SciPy - Linear Algebra-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/SciPy - Linear Algebra-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Scikit-Learn-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Scikit-Learn-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/Seaborn-Python DS Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/Seaborn-Python DS Cheat Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_Pandas_Cheat_Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_Pandas_Cheat_Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_Pandas_DataFrame_Notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_Pandas_DataFrame_Notes.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_Python_Matplotlib_Cheat_Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_Python_Matplotlib_Cheat_Sheet.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_Quotes_about_Python.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_Quotes_about_Python.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_Suggested_Reads_on_Stats_and_Maths_for_Data_Science.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_Suggested_Reads_on_Stats_and_Maths_for_Data_Science.pdf -------------------------------------------------------------------------------- /python-cheatsheet/attachment_python_cheat_sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python-cheatsheet/attachment_python_cheat_sheet.pdf -------------------------------------------------------------------------------- /python_class_tutorial.py: -------------------------------------------------------------------------------- 1 | # Create a class representing a person and then deffine attributes 2 | 3 | 4 | class Person: 5 | 6 | #Initialize few variable 7 | def __init__(self, name, age): 8 | self.name=name 9 | self.age=age 10 | 11 | #custom function speaks 12 | def speak(self): 13 | print("Hello my name is ",self.name) 14 | print("Hello my age is ",self.age) 15 | 16 | name=input("Please enter your name") 17 | age=input("Please enter your age") 18 | # aay - object 19 | # Person is the class 20 | aay=Person(name,age) 21 | aay.speak() -------------------------------------------------------------------------------- /python_samples/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/.DS_Store -------------------------------------------------------------------------------- /python_samples/1.2.1 - Tuples.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "### TUPLES\n", 8 | "- Collection of elements with different data types`\n", 9 | "\n", 10 | "- Tuple is an ordered sequence of items same as list.`\n", 11 | "\n", 12 | "- The only difference is that tuples are immutable. Tuples once created cannot be modified.`\n", 13 | "\n", 14 | "- Tuples are just like lists, but you cannot modify their values. The initial values are the values that will stay for the rest of the program.`\n" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "- The easiest way to create one is with a comma-separated sequence of values.\n", 22 | "- created by () and tuple()\n", 23 | "- The easiest way to create one is with a comma-separated sequence of values.\n" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 24, 29 | "metadata": {}, 30 | "outputs": [ 31 | { 32 | "data": { 33 | "text/plain": [ 34 | "30" 35 | ] 36 | }, 37 | "execution_count": 24, 38 | "metadata": {}, 39 | "output_type": "execute_result" 40 | } 41 | ], 42 | "source": [ 43 | "tup = 10 ,20 ,30,40,50,\"DataFolkz\"\n", 44 | "type(tup)\n", 45 | "tup[2]" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 25, 51 | "metadata": {}, 52 | "outputs": [ 53 | { 54 | "data": { 55 | "text/plain": [ 56 | "tuple" 57 | ] 58 | }, 59 | "execution_count": 25, 60 | "metadata": {}, 61 | "output_type": "execute_result" 62 | } 63 | ], 64 | "source": [ 65 | "type(tup)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 26, 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "data": { 75 | "text/plain": [ 76 | "10" 77 | ] 78 | }, 79 | "execution_count": 26, 80 | "metadata": {}, 81 | "output_type": "execute_result" 82 | } 83 | ], 84 | "source": [ 85 | "tup[0]" 86 | ] 87 | }, 88 | { 89 | "cell_type": "markdown", 90 | "metadata": {}, 91 | "source": [ 92 | "### Convert any sequence or iterator to a tuple by invoking tuple function." 93 | ] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "execution_count": 28, 98 | "metadata": {}, 99 | "outputs": [ 100 | { 101 | "data": { 102 | "text/plain": [ 103 | "[40, 50, 60, 'AI', 'ML']" 104 | ] 105 | }, 106 | "execution_count": 28, 107 | "metadata": {}, 108 | "output_type": "execute_result" 109 | } 110 | ], 111 | "source": [ 112 | "List1 = [40,50,60,\"AI\", 'ML']\n", 113 | "List1" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": 39, 119 | "metadata": {}, 120 | "outputs": [ 121 | { 122 | "data": { 123 | "text/plain": [ 124 | "list" 125 | ] 126 | }, 127 | "execution_count": 39, 128 | "metadata": {}, 129 | "output_type": "execute_result" 130 | } 131 | ], 132 | "source": [ 133 | "type(List1)" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": 38, 139 | "metadata": {}, 140 | "outputs": [ 141 | { 142 | "name": "stdout", 143 | "output_type": "stream", 144 | "text": [ 145 | "(40, 50, 60, 'AI', 'ML')\n", 146 | "\n" 147 | ] 148 | } 149 | ], 150 | "source": [ 151 | "tuple1 = tuple(List1) \n", 152 | "print(tuple1)# converted from list to tuple\n", 153 | "print(type(tuple1))" 154 | ] 155 | }, 156 | { 157 | "cell_type": "code", 158 | "execution_count": 35, 159 | "metadata": {}, 160 | "outputs": [ 161 | { 162 | "data": { 163 | "text/plain": [ 164 | "('p', 'y', 't', 'h', 'o', 'n')" 165 | ] 166 | }, 167 | "execution_count": 35, 168 | "metadata": {}, 169 | "output_type": "execute_result" 170 | } 171 | ], 172 | "source": [ 173 | "tuple('python') # using Strings" 174 | ] 175 | }, 176 | { 177 | "cell_type": "markdown", 178 | "metadata": {}, 179 | "source": [ 180 | "### Iterators\n", 181 | "\n", 182 | "- An iterator is an object that contains a countable number of values.\n", 183 | "\n", 184 | "- An iterator is an object that can be iterated upon, meaning that you can traverse through all the values.\n", 185 | "\n", 186 | "### Iterator vs Iterable\n", 187 | "\n", 188 | "- Lists, tuples, dictionaries, and sets are all iterable objects. They are iterable containers which you can get an iterator from.`\n", 189 | "\n", 190 | "- All these objects have a iter() method which is used to get an iterator:" 191 | ] 192 | }, 193 | { 194 | "cell_type": "code", 195 | "execution_count": 42, 196 | "metadata": {}, 197 | "outputs": [ 198 | { 199 | "data": { 200 | "text/plain": [ 201 | "('DataFolkz', 1, 2, 3, 5.8, True)" 202 | ] 203 | }, 204 | "execution_count": 42, 205 | "metadata": {}, 206 | "output_type": "execute_result" 207 | } 208 | ], 209 | "source": [ 210 | "my_tup = ('DataFolkz',1,2,3,5.8,True)\n", 211 | "my_tup" 212 | ] 213 | }, 214 | { 215 | "cell_type": "code", 216 | "execution_count": 43, 217 | "metadata": {}, 218 | "outputs": [ 219 | { 220 | "data": { 221 | "text/plain": [ 222 | "tuple" 223 | ] 224 | }, 225 | "execution_count": 43, 226 | "metadata": {}, 227 | "output_type": "execute_result" 228 | } 229 | ], 230 | "source": [ 231 | "type(my_tup)" 232 | ] 233 | }, 234 | { 235 | "cell_type": "code", 236 | "execution_count": 44, 237 | "metadata": {}, 238 | "outputs": [ 239 | { 240 | "data": { 241 | "text/plain": [ 242 | "'DataFolkz'" 243 | ] 244 | }, 245 | "execution_count": 44, 246 | "metadata": {}, 247 | "output_type": "execute_result" 248 | } 249 | ], 250 | "source": [ 251 | "# Indexing \n", 252 | "\n", 253 | "my_tup[0]" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": 45, 259 | "metadata": {}, 260 | "outputs": [ 261 | { 262 | "data": { 263 | "text/plain": [ 264 | "True" 265 | ] 266 | }, 267 | "execution_count": 45, 268 | "metadata": {}, 269 | "output_type": "execute_result" 270 | } 271 | ], 272 | "source": [ 273 | "my_tup[-1]" 274 | ] 275 | }, 276 | { 277 | "cell_type": "code", 278 | "execution_count": 46, 279 | "metadata": {}, 280 | "outputs": [ 281 | { 282 | "data": { 283 | "text/plain": [ 284 | "('DataFolkz', 1, 2)" 285 | ] 286 | }, 287 | "execution_count": 46, 288 | "metadata": {}, 289 | "output_type": "execute_result" 290 | } 291 | ], 292 | "source": [ 293 | "my_tup[:3]" 294 | ] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "execution_count": 47, 299 | "metadata": {}, 300 | "outputs": [ 301 | { 302 | "data": { 303 | "text/plain": [ 304 | "2" 305 | ] 306 | }, 307 | "execution_count": 47, 308 | "metadata": {}, 309 | "output_type": "execute_result" 310 | } 311 | ], 312 | "source": [ 313 | "my_tup.count(1)" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": 48, 319 | "metadata": {}, 320 | "outputs": [ 321 | { 322 | "data": { 323 | "text/plain": [ 324 | "4" 325 | ] 326 | }, 327 | "execution_count": 48, 328 | "metadata": {}, 329 | "output_type": "execute_result" 330 | } 331 | ], 332 | "source": [ 333 | "my_tup.index(5.8)" 334 | ] 335 | }, 336 | { 337 | "cell_type": "code", 338 | "execution_count": 50, 339 | "metadata": {}, 340 | "outputs": [ 341 | { 342 | "ename": "AttributeError", 343 | "evalue": "'tuple' object has no attribute 'append'", 344 | "output_type": "error", 345 | "traceback": [ 346 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 347 | "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", 348 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m# append 'Technology' in tuple\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mmy_tup\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Technology\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 349 | "\u001b[1;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'" 350 | ] 351 | } 352 | ], 353 | "source": [ 354 | "# append 'Technology' in tuple\n", 355 | "my_tup.a" 356 | ] 357 | }, 358 | { 359 | "cell_type": "markdown", 360 | "metadata": {}, 361 | "source": [ 362 | "# Converting into List from tuple\n", 363 | "\n", 364 | "- to make make the change something convert the tuple into list and change it." 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 16, 370 | "metadata": {}, 371 | "outputs": [ 372 | { 373 | "data": { 374 | "text/plain": [ 375 | "['DataFolkz', 1, 2, 3, 5.8, True]" 376 | ] 377 | }, 378 | "execution_count": 16, 379 | "metadata": {}, 380 | "output_type": "execute_result" 381 | } 382 | ], 383 | "source": [ 384 | "# Convert tuple into list\n", 385 | "# list\n", 386 | "list1 = list(my_tup)\n", 387 | "list1" 388 | ] 389 | }, 390 | { 391 | "cell_type": "code", 392 | "execution_count": 17, 393 | "metadata": {}, 394 | "outputs": [ 395 | { 396 | "data": { 397 | "text/plain": [ 398 | "list" 399 | ] 400 | }, 401 | "execution_count": 17, 402 | "metadata": {}, 403 | "output_type": "execute_result" 404 | } 405 | ], 406 | "source": [ 407 | "type(list1)" 408 | ] 409 | }, 410 | { 411 | "cell_type": "code", 412 | "execution_count": 18, 413 | "metadata": {}, 414 | "outputs": [], 415 | "source": [ 416 | "list1.append('Technology')" 417 | ] 418 | }, 419 | { 420 | "cell_type": "code", 421 | "execution_count": 19, 422 | "metadata": {}, 423 | "outputs": [ 424 | { 425 | "data": { 426 | "text/plain": [ 427 | "['DataFolkz', 1, 2, 3, 5.8, True, 'Technology']" 428 | ] 429 | }, 430 | "execution_count": 19, 431 | "metadata": {}, 432 | "output_type": "execute_result" 433 | } 434 | ], 435 | "source": [ 436 | "list1" 437 | ] 438 | }, 439 | { 440 | "cell_type": "markdown", 441 | "metadata": {}, 442 | "source": [ 443 | "# Converting from List to Tuple" 444 | ] 445 | }, 446 | { 447 | "cell_type": "code", 448 | "execution_count": 20, 449 | "metadata": {}, 450 | "outputs": [], 451 | "source": [ 452 | "# convert into tuple\n", 453 | "my_tup1 = tuple(list1)" 454 | ] 455 | }, 456 | { 457 | "cell_type": "code", 458 | "execution_count": 21, 459 | "metadata": {}, 460 | "outputs": [ 461 | { 462 | "data": { 463 | "text/plain": [ 464 | "tuple" 465 | ] 466 | }, 467 | "execution_count": 21, 468 | "metadata": {}, 469 | "output_type": "execute_result" 470 | } 471 | ], 472 | "source": [ 473 | "type(my_tup1)" 474 | ] 475 | }, 476 | { 477 | "cell_type": "code", 478 | "execution_count": 22, 479 | "metadata": {}, 480 | "outputs": [ 481 | { 482 | "data": { 483 | "text/plain": [ 484 | "('DataFolkz', 1, 2, 3, 5.8, True, 'Technology')" 485 | ] 486 | }, 487 | "execution_count": 22, 488 | "metadata": {}, 489 | "output_type": "execute_result" 490 | } 491 | ], 492 | "source": [ 493 | "my_tup1" 494 | ] 495 | } 496 | ], 497 | "metadata": { 498 | "kernelspec": { 499 | "display_name": "Python 3", 500 | "language": "python", 501 | "name": "python3" 502 | }, 503 | "language_info": { 504 | "codemirror_mode": { 505 | "name": "ipython", 506 | "version": 3 507 | }, 508 | "file_extension": ".py", 509 | "mimetype": "text/x-python", 510 | "name": "python", 511 | "nbconvert_exporter": "python", 512 | "pygments_lexer": "ipython3", 513 | "version": "3.8.8" 514 | } 515 | }, 516 | "nbformat": 4, 517 | "nbformat_minor": 2 518 | } 519 | -------------------------------------------------------------------------------- /python_samples/Encapsulation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "#### Encapsulation\n", 8 | "\n", 9 | "In an object oriented python program, you can restrict access to methods and variables. This can prevent the data from being modified by accident and is known as encapsulation. Let’s start with an example.\n", 10 | "\n", 11 | "We create a class Car which has two methods: drive() and updateSoftware(). When a car object is created, it will call the private methods __updateSoftware(). \n", 12 | "\n", 13 | "\n", 14 | " \n", 15 | "This function cannot be called on the object directly, only from within the class." 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": 7, 21 | "metadata": {}, 22 | "outputs": [ 23 | { 24 | "name": "stdout", 25 | "output_type": "stream", 26 | "text": [ 27 | "updating software\n", 28 | "driving\n" 29 | ] 30 | } 31 | ], 32 | "source": [ 33 | "class Car:\n", 34 | "\n", 35 | " def __init__(self):\n", 36 | " self.__updateSoftware()\n", 37 | "\n", 38 | " def drive(self):\n", 39 | " print('driving')\n", 40 | "\n", 41 | " def __updateSoftware(self):\n", 42 | " print('updating software')\n", 43 | "\n", 44 | "redcar = Car()\n", 45 | "redcar.drive()\n", 46 | "#redcar.__updateSoftware() not accesible from object." 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "Encapsulation prevents from accessing accidentally, but not intentionally.\n", 54 | "\n", 55 | "The private attributes and methods are not really hidden, they’re renamed adding _Car” in the beginning of their name.\n", 56 | "\n", 57 | "The method can actually be called using redcar._Car__updateSoftware()\n", 58 | "\n", 59 | "Private variables\n", 60 | "\n", 61 | "encapsulation-example\n", 62 | "\n", 63 | "Class with private variables\n", 64 | "\n", 65 | "Variables can be private which can be useful on many occasions. \n", 66 | "\n", 67 | "A private variable can only be changed within a class method and not outside of the class.\n", 68 | "\n", 69 | "Objects can hold crucial data for your application and you do not want that data to be changeable from anywhere in the code.\n", 70 | "An example:" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": 8, 76 | "metadata": {}, 77 | "outputs": [ 78 | { 79 | "name": "stdout", 80 | "output_type": "stream", 81 | "text": [ 82 | "driving. maxspeed 200\n", 83 | "driving. maxspeed 200\n" 84 | ] 85 | } 86 | ], 87 | "source": [ 88 | "class Car:\n", 89 | "\n", 90 | " __maxspeed = 0\n", 91 | " __name = \"\"\n", 92 | " \n", 93 | " def __init__(self):\n", 94 | " self.__maxspeed = 200\n", 95 | " self.__name = \"Supercar\"\n", 96 | " \n", 97 | " def drive(self):\n", 98 | " print('driving. maxspeed ' + str(self.__maxspeed))\n", 99 | "\n", 100 | "redcar = Car()\n", 101 | "redcar.drive()\n", 102 | "redcar.__maxspeed = 10 # will not change variable because its private\n", 103 | "redcar.drive()" 104 | ] 105 | }, 106 | { 107 | "cell_type": "markdown", 108 | "metadata": {}, 109 | "source": [ 110 | "If you want to change the value of a private variable, a setter method is used. This is simply a method that sets the value of a private variable." 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": 10, 116 | "metadata": {}, 117 | "outputs": [ 118 | { 119 | "name": "stdout", 120 | "output_type": "stream", 121 | "text": [ 122 | "driving. maxspeed 200\n", 123 | "driving. maxspeed 320\n" 124 | ] 125 | } 126 | ], 127 | "source": [ 128 | "class Car:\n", 129 | "\n", 130 | " __maxspeed = 0\n", 131 | " __name = \"\"\n", 132 | " \n", 133 | " def __init__(self):\n", 134 | " self.__maxspeed = 200\n", 135 | " self.__name = \"Supercar\"\n", 136 | " \n", 137 | " def drive(self):\n", 138 | " print('driving. maxspeed ' + str(self.__maxspeed))\n", 139 | "\n", 140 | " def setMaxSpeed(self,speed):\n", 141 | " self.__maxspeed = speed\n", 142 | "\n", 143 | "redcar = Car()\n", 144 | "redcar.drive()\n", 145 | "redcar.setMaxSpeed(320)\n", 146 | "redcar.drive()" 147 | ] 148 | }, 149 | { 150 | "cell_type": "markdown", 151 | "metadata": {}, 152 | "source": [ 153 | "##### Why would you create them? \n", 154 | "\n", 155 | "Because some of the private values you may want to change after creation of the object while others may not need to be changed at all.\n", 156 | "\n", 157 | "Python Encapsulation\n", 158 | "\n", 159 | "To summarize, in Python there are:\n", 160 | "\n", 161 | "Other programming languages have protected class methods too, but Python does not.\n", 162 | "Encapsulation gives you more control over the degree of coupling in your code, it allows a class to change its implementation without affecting other parts of the code." 163 | ] 164 | } 165 | ], 166 | "metadata": { 167 | "kernelspec": { 168 | "display_name": "Python 3", 169 | "language": "python", 170 | "name": "python3" 171 | }, 172 | "language_info": { 173 | "codemirror_mode": { 174 | "name": "ipython", 175 | "version": 3 176 | }, 177 | "file_extension": ".py", 178 | "mimetype": "text/x-python", 179 | "name": "python", 180 | "nbconvert_exporter": "python", 181 | "pygments_lexer": "ipython3", 182 | "version": "3.8.8" 183 | } 184 | }, 185 | "nbformat": 4, 186 | "nbformat_minor": 4 187 | } 188 | -------------------------------------------------------------------------------- /python_samples/Operators in Python updated.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Operators" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "#see the value of multiple statements\n", 17 | "#output for all commands in python jupyter notebook\n", 18 | "# Specifying which nodes should be run interactively such as 'all','last'..\n", 19 | "\n", 20 | "from IPython.core.interactiveshell import InteractiveShell\n", 21 | "InteractiveShell.ast_node_interactivity = \"all\"" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "### This notebook deals with different types of operators in Python\n" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "###### What are operators in python?\n", 36 | "Operators are special symbols in Python that carry out arithmetic or logical computation. The value that the operator operates on is called the operand.\n", 37 | "\n" 38 | ] 39 | }, 40 | { 41 | "cell_type": "markdown", 42 | "metadata": {}, 43 | "source": [ 44 | "For example: 8+3 = 11\n", 45 | "\n", 46 | "Here, + is the operator that performs addition. 8 and 3 are the operands and 11 is the output of the operation." 47 | ] 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "1. Arithmetic operators\n", 54 | " \n", 55 | "2. Bitwise operators \n", 56 | "\n", 57 | "3. Assignment operators\n", 58 | "\n", 59 | "4. Comparison (Relational) operators\n", 60 | "\n", 61 | "5. Logical (Boolean) operators\n", 62 | "\n", 63 | "6. Special operators" 64 | ] 65 | }, 66 | { 67 | "cell_type": "markdown", 68 | "metadata": {}, 69 | "source": [ 70 | "## Arithmetic operators: \n", 71 | " \n", 72 | " Arithmetic operators are used to perform mathematical operations like addition, \n", 73 | " subtraction, multiplication and division." 74 | ] 75 | }, 76 | { 77 | "cell_type": "markdown", 78 | "metadata": {}, 79 | "source": [ 80 | "- Addition: adds two operands and the syntax is x + y\n", 81 | "- Subtraction: subtracts two operands and the syntax is x - y\n", 82 | "- Multiplication: multiplies two operands and the syntax is x * y\n", 83 | "- Division (float): divides the first operand by the second and the syntax is x / y\n", 84 | "- Division (floor): divides the first operand by the second and the syntax x // y\n", 85 | "- Modulus:Returns the remainder when first operand is divided by the second and the synatx is x % y\n" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 2, 91 | "metadata": {}, 92 | "outputs": [ 93 | { 94 | "name": "stdout", 95 | "output_type": "stream", 96 | "text": [ 97 | "6\n", 98 | "12879\n", 99 | "4\n", 100 | "-1\n", 101 | "48\n", 102 | "204\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "# Addition\n", 108 | "print(2 + 4) \n", 109 | "print(12878 + 1)\n", 110 | "\n", 111 | "# Subtraction\n", 112 | "print(7 - 3) \n", 113 | "print(127 - 128)\n", 114 | "\n", 115 | "# Multiplication\n", 116 | "print(8 * 6)\n", 117 | "print(17 * 12)" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": {}, 123 | "source": [ 124 | "There are two division operators: / for everyday (float) division and // for truncating (integer) division" 125 | ] 126 | }, 127 | { 128 | "cell_type": "code", 129 | "execution_count": 4, 130 | "metadata": {}, 131 | "outputs": [ 132 | { 133 | "name": "stdout", 134 | "output_type": "stream", 135 | "text": [ 136 | "4.25\n", 137 | "4\n" 138 | ] 139 | } 140 | ], 141 | "source": [ 142 | "# Division\n", 143 | "print(17 / 4)\n", 144 | "print(17 // 4)" 145 | ] 146 | }, 147 | { 148 | "cell_type": "markdown", 149 | "metadata": {}, 150 | "source": [ 151 | "The modulo operator % and the exponentiation operator ** are also available." 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 5, 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "name": "stdout", 161 | "output_type": "stream", 162 | "text": [ 163 | "0\n", 164 | "2\n" 165 | ] 166 | } 167 | ], 168 | "source": [ 169 | "# Modulus/ Remainder\n", 170 | "print(18 % 3)\n", 171 | "print(72 % 5)" 172 | ] 173 | }, 174 | { 175 | "cell_type": "markdown", 176 | "metadata": {}, 177 | "source": [ 178 | "The usual operator precedence rules and use of parentheses to override that are available" 179 | ] 180 | }, 181 | { 182 | "cell_type": "code", 183 | "execution_count": 6, 184 | "metadata": {}, 185 | "outputs": [ 186 | { 187 | "name": "stdout", 188 | "output_type": "stream", 189 | "text": [ 190 | "697\n", 191 | "99999999999997\n", 192 | "100000000000\n" 193 | ] 194 | } 195 | ], 196 | "source": [ 197 | "# Arithematic operations\n", 198 | "print(10 ** 2 * 7 - 3)\n", 199 | "print(10 ** (2 * 7) - 3)\n", 200 | "print(10 ** (2 * 7 - 3))" 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": 3, 206 | "metadata": {}, 207 | "outputs": [ 208 | { 209 | "name": "stdout", 210 | "output_type": "stream", 211 | "text": [ 212 | "95895286347222034791086605662811969785387106853901346544483953642680116799305429392916328044803964544906412568173586838975389693889466931724787382602209026851413718672992500945459050967973754074446682840115185173491232894943036718270805266686475439556591818306146142541531042457606878440869168972012200929781450791973866289435058898863980805449821148199924662026572772426330363272818353600292677639914650163602402387046082945396504228157351617787966026866638977428336270761039733807499229574152744708406709999198108421875593674670017724918532931998179661679487371607921869488779614480174654183050554148246295513430972687654798140382162446340357982348270186444388129720941541158390538541492685710752623852622720768334430468852097226917149171660953626254466986940765253382358001339174903296347169720023617297994349779160697050425373047121064748421434125128308764115407012030949147264066116731171517339637266846118243586757670417982965125332116703787163047835949441767799201\n" 213 | ] 214 | } 215 | ], 216 | "source": [ 217 | "# Exponential of the number example, 2^3 = 8\n", 218 | "a = 123456789 \n", 219 | "b = a ** 2\n", 220 | "c = b ** 3\n", 221 | "d = c ** 4\n", 222 | "e = d ** 5\n", 223 | "print(e)" 224 | ] 225 | }, 226 | { 227 | "cell_type": "markdown", 228 | "metadata": {}, 229 | "source": [ 230 | "##### Assignment operators\n", 231 | "The standard assignment operators are available. That is, $\\alpha$ $\\odot=\\beta$ is a shorthand for $\\alpha = \\alpha \\odot \\beta$\n", 232 | "where $\\odot$ is any binary arithmetic operator we saw above" 233 | ] 234 | }, 235 | { 236 | "cell_type": "code", 237 | "execution_count": 10, 238 | "metadata": {}, 239 | "outputs": [ 240 | { 241 | "name": "stdout", 242 | "output_type": "stream", 243 | "text": [ 244 | "17 5\n", 245 | "12 5\n", 246 | "60 5\n", 247 | "777600000 5\n" 248 | ] 249 | } 250 | ], 251 | "source": [ 252 | "a = 12\n", 253 | "b = 5\n", 254 | "a += b\n", 255 | "print(a, b)\n", 256 | "a -= b\n", 257 | "print(a, b)\n", 258 | "a *= b\n", 259 | "print(a, b)\n", 260 | "a **=b\n", 261 | "print(a,b)" 262 | ] 263 | }, 264 | { 265 | "cell_type": "markdown", 266 | "metadata": {}, 267 | "source": [ 268 | "#### Boolean\n", 269 | "The two constants True and False are defined.\n", 270 | "\n", 271 | "The usual boolean operators are also available: ==, !=, >, >=, <, <= " 272 | ] 273 | }, 274 | { 275 | "cell_type": "code", 276 | "execution_count": 12, 277 | "metadata": {}, 278 | "outputs": [ 279 | { 280 | "name": "stdout", 281 | "output_type": "stream", 282 | "text": [ 283 | "True False True True False\n" 284 | ] 285 | } 286 | ], 287 | "source": [ 288 | "a = 12\n", 289 | "b = 13\n", 290 | "print(a == b - 1,a == b, a != b, a < b, a >= b)" 291 | ] 292 | }, 293 | { 294 | "cell_type": "markdown", 295 | "metadata": {}, 296 | "source": [ 297 | "#### Float\n", 298 | "Python has a float datatype (and it is the same as C's double!) and the above operations are available" 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": 13, 304 | "metadata": {}, 305 | "outputs": [ 306 | { 307 | "name": "stdout", 308 | "output_type": "stream", 309 | "text": [ 310 | "12.9\n", 311 | "3.6\n", 312 | "16.5\n", 313 | "9.3\n", 314 | "46.440000000000005\n", 315 | "3.5833333333333335\n", 316 | "12.9 3.6 16.5 9.3 46.440000000000005 3.5833333333333335\n" 317 | ] 318 | } 319 | ], 320 | "source": [ 321 | "a = 12.9\n", 322 | "b = 3.6\n", 323 | "c = a + b\n", 324 | "d = a - b\n", 325 | "e = a * b #Watch out for the round off error!\n", 326 | "f = a / b\n", 327 | "print(a, b, c, d, e, f, sep=\"\\n\")\n", 328 | "print(a, b, c, d, e, f)" 329 | ] 330 | }, 331 | { 332 | "cell_type": "markdown", 333 | "metadata": {}, 334 | "source": [ 335 | "## Bitwise operators: \n", 336 | "Bitwise operators acts on bits and performs bit by bit operation." 337 | ] 338 | }, 339 | { 340 | "cell_type": "markdown", 341 | "metadata": {}, 342 | "source": [ 343 | "- Bitwise AND---- x & y\n", 344 | "- Bitwise OR---- x | y\n", 345 | "- Bitwise NOT---- ~x\n", 346 | "- Bitwise XOR---- x ^ y\n", 347 | "- Bitwise right shift---- x>>\n", 348 | "- Bitwise left shift---- x<<" 349 | ] 350 | }, 351 | { 352 | "cell_type": "code", 353 | "execution_count": 21, 354 | "metadata": {}, 355 | "outputs": [ 356 | { 357 | "name": "stdout", 358 | "output_type": "stream", 359 | "text": [ 360 | "Value of c is 12\n", 361 | "Value of c is 61\n", 362 | "Value of c is 49\n", 363 | "Value of c is -61\n", 364 | "Value of c is 240\n", 365 | "Value of c is 15\n" 366 | ] 367 | } 368 | ], 369 | "source": [ 370 | "a = 60 # 60 = 0011 1100 \n", 371 | "b = 13 # 13 = 0000 1101 \n", 372 | "c = 0\n", 373 | "\n", 374 | "c = a & b; # 12 = 0000 1100\n", 375 | "print (\"Value of c is \",c)\n", 376 | "\n", 377 | "c = a | b; # 61 = 0011 1101 \n", 378 | "print (\"Value of c is \",c)\n", 379 | "\n", 380 | "c = a ^ b; # 49 = 0011 0001\n", 381 | "print (\"Value of c is \",c)\n", 382 | "\n", 383 | "\n", 384 | "c = ~a; # -61 = 1100 0011\n", 385 | "print (\"Value of c is \",c)\n", 386 | "\n", 387 | "#The left operands value is moved left by the number of bits specified by the right operand.\n", 388 | "c = a << 2; # 240 = 1111 0000\n", 389 | "print (\"Value of c is \",c) \n", 390 | "\n", 391 | "#The left operands value is moved right by the number of bits specified by the right operand.\n", 392 | "c = a >> 2; # 15 = 0000 1111\n", 393 | "print (\"Value of c is \",c)" 394 | ] 395 | }, 396 | { 397 | "cell_type": "markdown", 398 | "metadata": {}, 399 | "source": [ 400 | "### Relational Operators: \n", 401 | " Relational operators compares the values. It either returns True or False according to the condition.\n", 402 | "\n", 403 | "- Greater than: True if left operand is greater than the right---- x > y\n", 404 | "- Less than: True if left operand is less than the right---- x < y\n", 405 | "- Equal to: True if both operands are equal---- x == y\n", 406 | "- Not equal to - True if operands are not equal---- x != y\n", 407 | "- Greater than or equal to: True if left operand is greater than or equal to the right---- x >= y\n", 408 | "- Less than or equal to: True if left operand is less than or equal to the right---- x <= y" 409 | ] 410 | }, 411 | { 412 | "cell_type": "code", 413 | "execution_count": 22, 414 | "metadata": {}, 415 | "outputs": [ 416 | { 417 | "name": "stdout", 418 | "output_type": "stream", 419 | "text": [ 420 | "False\n", 421 | "True\n", 422 | "False\n", 423 | "True\n", 424 | "False\n", 425 | "True\n" 426 | ] 427 | } 428 | ], 429 | "source": [ 430 | "# Examples of Relational Operators \n", 431 | "a = 25\n", 432 | "b = 47\n", 433 | " \n", 434 | "# a > b is False \n", 435 | "print(a > b) \n", 436 | " \n", 437 | "# a < b is True \n", 438 | "print(a < b) \n", 439 | " \n", 440 | "# a == b is False \n", 441 | "print(a == b) \n", 442 | " \n", 443 | "# a != b is True \n", 444 | "print(a != b) \n", 445 | " \n", 446 | "# a >= b is False \n", 447 | "print(a >= b) \n", 448 | " \n", 449 | "# a <= b is True \n", 450 | "print(a <= b) " 451 | ] 452 | }, 453 | { 454 | "cell_type": "markdown", 455 | "metadata": {}, 456 | "source": [ 457 | "### Logical operators: \n", 458 | " Logical operators perform Logical AND, Logical OR and Logical NOT operations.\n", 459 | "\n", 460 | "\n", 461 | "- Logical AND: True if both the operands are true---- x and y\n", 462 | "- Logical OR: True if either of the operands is true--- x or y\n", 463 | "- Logical NOT: True if operand is false--- not x\n" 464 | ] 465 | }, 466 | { 467 | "cell_type": "code", 468 | "execution_count": 24, 469 | "metadata": {}, 470 | "outputs": [ 471 | { 472 | "name": "stdout", 473 | "output_type": "stream", 474 | "text": [ 475 | "False\n", 476 | "True\n", 477 | "False\n" 478 | ] 479 | } 480 | ], 481 | "source": [ 482 | "# Examples of Logical Operator \n", 483 | "a = True\n", 484 | "b = False\n", 485 | " \n", 486 | "# Print a and b is False \n", 487 | "print(a and b) \n", 488 | " \n", 489 | "# Print a or b is True \n", 490 | "print(a or b) \n", 491 | " \n", 492 | "# Print not a is False \n", 493 | "print(not a) " 494 | ] 495 | }, 496 | { 497 | "cell_type": "markdown", 498 | "metadata": {}, 499 | "source": [ 500 | "### Special operators:\n", 501 | " There are some special type of operators like-\n", 502 | "###### Identity operators-\n", 503 | "is and is not are the identity operators both are used to check if two values are located on the same part of the memory. Two variables that are equal does not imply that they are identical.\n", 504 | "- is True if the operands are identical \n", 505 | "- is not True if the operands are not identical" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "execution_count": 26, 511 | "metadata": {}, 512 | "outputs": [ 513 | { 514 | "name": "stdout", 515 | "output_type": "stream", 516 | "text": [ 517 | "False\n", 518 | "True\n", 519 | "False\n" 520 | ] 521 | } 522 | ], 523 | "source": [ 524 | "# Examples of Identity operators \n", 525 | "a1 = 3\n", 526 | "b1 = 3\n", 527 | "a2 = 'Datafolkz'\n", 528 | "b2 = 'Datafolkz'\n", 529 | "a3 = [1,2,3] \n", 530 | "b3 = [1,2,3] \n", 531 | " \n", 532 | "print(a1 is not b1) \n", 533 | " \n", 534 | "print(a2 is b2) \n", 535 | " \n", 536 | "# Output is False, since lists are mutable. \n", 537 | "print(a3 is b3) " 538 | ] 539 | } 540 | ], 541 | "metadata": { 542 | "kernelspec": { 543 | "display_name": "Python 3", 544 | "language": "python", 545 | "name": "python3" 546 | }, 547 | "language_info": { 548 | "codemirror_mode": { 549 | "name": "ipython", 550 | "version": 3 551 | }, 552 | "file_extension": ".py", 553 | "mimetype": "text/x-python", 554 | "name": "python", 555 | "nbconvert_exporter": "python", 556 | "pygments_lexer": "ipython3", 557 | "version": "3.8.8" 558 | } 559 | }, 560 | "nbformat": 4, 561 | "nbformat_minor": 4 562 | } 563 | -------------------------------------------------------------------------------- /python_samples/assignment/Conditional statements assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/Conditional statements assignment.pdf -------------------------------------------------------------------------------- /python_samples/assignment/Dictionary assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/Dictionary assignment.pdf -------------------------------------------------------------------------------- /python_samples/assignment/Functions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/Functions.pdf -------------------------------------------------------------------------------- /python_samples/assignment/List assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/List assignment.pdf -------------------------------------------------------------------------------- /python_samples/assignment/Loops assignment (1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/Loops assignment (1).pdf -------------------------------------------------------------------------------- /python_samples/assignment/OOPS Assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/OOPS Assignment.pdf -------------------------------------------------------------------------------- /python_samples/assignment/String assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/String assignment.pdf -------------------------------------------------------------------------------- /python_samples/assignment/Tuple and set assignment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aayushkubb/Python_Tutorial/82abf146301d72c696bc485cd0529fbe2fa2b2a7/python_samples/assignment/Tuple and set assignment.pdf -------------------------------------------------------------------------------- /sample.py: -------------------------------------------------------------------------------- 1 | print("My name is aayush") -------------------------------------------------------------------------------- /sample_tweets.txt: -------------------------------------------------------------------------------- 1 | Aayush Kubba 2 | I want to go for a movie. #movietime 3 | I love data science. #Ml #AI 4 | I hate coding. #notAProgrammer 5 | I want to explore. #travel 6 | Born to be #awesome.This is jupyter #python 7 | This is jupyter #python 8 | This is jupyter #python 9 | This is jupyter #python --------------------------------------------------------------------------------