<jupyter_start><jupyter_text>Chapter 1.3 Introduction to Python Function  1.3.1 Let us create three variables, we will be using it throughout...<jupyter_code>var1 = [119, 83, 6, 20, -1]
var2 = ["cat","dog","pig","bear"]
var3 = [True, False]
var4 = ["Sushi",94]<jupyter_output><empty_output><jupyter_text>1.3.2 Max, Min and Length of a list<jupyter_code>print(len(var1))
#Remember, you always need to print the function to see the results...
max(var1)
min(var1) #No need to print
complex(6,2) #By the way, creating a complex number...<jupyter_output><empty_output><jupyter_text>1.3.3. Sorting the data<jupyter_code>var5= sorted(var1, reverse=True)
print(var5)
print(var1) #Think about section 1.2, Why var1 is not infected this time? Sort is a function producing output, the 
#original data is not changed...<jupyter_output>[119, 83, 6, 20, -1]<jupyter_text>1.3.4. working with strings<jupyter_code>pig = "PigGy"
bigpig = pig.upper()
print(bigpig)
print(bigpig.count("g")) # count the number of occurrence of letter 'g' in bigpig.
print(var2.index("dog")) # find where dog is in the list 'var2'<jupyter_output>PIGGY
0
1<jupyter_text>*Exercise 1.5: (1) Create a 'smallpig' comprised of all lower case letters. (2) Why, in the last example, when counting the letter g, Python returns a result of 0 instead of 2?*  1.3.5. Append and Reverse the List<jupyter_code>var1.append(-5.5)
print(var1)
var1.reverse() #this change the structure of var1, because we did not operate in a duplicate...
print(var1)<jupyter_output>[-5.5, -1, 20, 6, 83, 119]<jupyter_text>1.3.6 Importing Packages and Library*__!!!Note!!! To start this section, please make sure you have the newest version of Anaconda, panda, numpy, sklearn, matplotlib to your computer!!__*<jupyter_code>#Python is not very powerful unless we import good libraries with packages. Here I introduce some of the most
#common packages in Python for data science
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt #using as to create a short cut...<jupyter_output><empty_output><jupyter_text>*you can also be selective in what you want to import in a big library of packages*<jupyter_code>from sklearn.linear_model import LogisticRegression<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11195700850873265, 'fraction_numerical': 0.03761755485893417, 'mean_word_length': 5.629080118694362, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '651193', 'license': 'Apache-2.0', 'n_tokens_mistral': 805, 'n_tokens_neox': 764, 'n_words': 273, 'path': 'Chapter1/Chapter1-3.ipynb', 'repo_name': 'biggyd/Python_for_Little_Piggy', 'size': '2233'}