by Diego Calvo | Jul 17, 2017 | Python-example
Setting up the virtual environment in PyCharm CE Initially when creating a project you can directly specify the virtual environment to use (where we can have different environments with different versions of Python) Change the virtual environment From PyCharm... by Diego Calvo | Jul 17, 2017 | Python-example
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... by Diego Calvo | Jul 15, 2017 | Python-example
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,... by Diego Calvo | Jul 15, 2017 | Python-example
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”,... by Diego Calvo | Jul 15, 2017 | Python-example
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,...