how to open pyhthon notebook from cmd prompt
conda update conda
conda update --all
####how to see which version of pandas#######
import pandas
pandas.__version__
exit()
####### Which directory to go ###########################
D:
D:\>dir
cd Data_carpentry
D:\Data_carpentry>jupyter notebook
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt
df = pd.read_csv("D:/2-dayworkshoponDatacarpentry/python_data/inflammation-01.csv",sep=",",header = None) df.head()
how to write a loop initialize and increment the loop
University = "FloridaState" count = 0 # initialize the loop for character in University: count = count + len(character) # increment the loop print(count) #len(University)
How to print first element of a list in python
InFileName = ("R:/Python_files/Phenotype.1.files/raw.file.txt") Infile = open(InFileName,"r") i = 0 for line in Infile.readlines(): try: if "Getting pedigree" in line: pass else: print(i, ':', line.split()[0]) i+=1 if i>35: assert(False) except: pass