Installing Python development environment

Install Python To facilitate this step and successive steps, you can install Anaconda   Install Python 2.7 in Centos 7 Check Python version > python Note: When you enter Python you can see the active version of it. Use exit() to finish Check Centos version...

Read and write files in Python

Reading. CSV files import os os.chdir(‘/Users/diego/Documents/test/facta_example/’) print (os.getcwd()) import pandas as pd file_csv = pd.read_csv(‘list_groups.csv’, delimiter=”;”) file_csv file_csv.describe() cell = file_csv.loc[1,...

For and while in Python

Example: traversing a string with a FOR seq = “Diego” for letter in seq: print(“Letter :”, letter) Letter : D Letter : i Letter : e Letter : g Letter : o Example: traversing an array with a FOR data = [“pears”, “apples”,...

Python function

Function example 1 Function that adds two numbers entered per parameter def my_sum(n1, n2):     total = n1 + n2     print (total) my_sum(1,2) 3   Function example 2 Function that returns two numbers passed as a list def my_sum(n1, n2): return n1 + n2 data = [1,...