Skip to content

bberkela/datacert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

datacert

Data Certificate Program

April 9, 2018

Files for homework for Course 5 Task 1 UT Data Certificate Program

#########################3

Folder Includes:

REPORT

######################################################################

ERRORS & WARNING MESSAGES

######################################################################

The errors/warning messages that you encountered and how you overcame them (these should be in the form of markdown cells)

NOTE: E stands for error

E1) Warned me that there was a new version of pip (couldn't copy and paste from command line yet)

Updated pip following instructions on screen. Received one "syntax" error messages because I was not in the right folder

for the python installation. "'python' is not recognized as an internal or external command, operable program or batch file."

Took less than minutes to get to the right path, update pip and confirm that all the other

Anaconda items were up-to-date.

E2) Warning in Jupyter Notebooks (missing parathenses). Easy to fix. Me trying to remember print commands from Python after a long day

day of work. Easy to fix. Followed instructions

File "", line 2

# print myStrong

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(myStrong)?

E3) Warning because didn't import a module

---------------------------------------------------------------------------

NameError Traceback (most recent call last)

in ()

1 # get current time

----> 2 datetime.datetime.now()

NameError: name 'datetime' is not defined

E4) Typo type errors

File "", line 6

return Value1 + Value 2

                      ^

SyntaxError: invalid syntax

Simply retyped the typo. Go back and quickly check. Syntax errors simply to fix

Python is Case Sensitive

E5) Intentionally provided only one argument to create error as requested in Ch. 4 Tutorial

Trying DoSum with one argument to create an error message

def DoSum(1,2)

Trying DoSum with one argument to create an error message

def DoSum(1,2)

File "", line 2

# def DoSum(1,2)
          ^

SyntaxError: invalid syntax

E6) Error "unexpected EOF"

def DisplaySum(Value1, Value2):

print(str(Value1) + ' + ' + str(Value2) + ' = ' +

str((Value1 + Value2))

sending argument bey keywords so you don't necessarily have to have the values in order needed

def DisplaySum(Value1, Value2):

print(str(Value1) + ' + ' + str(Value2) + ' = ' +

str((Value1 + Value2))

File "", line 4

# str((Value1 + Value2))                  ^

SyntaxError: unexpected EOF while parsing

Needed extra ) because of end of file issue

E7) Got a syntax error on page 72 with the code.

I typed Var Args as written but thought it seemed weird that it had a space

got syntax error. Took out space. Typo in textbook.

#E8) Atom the texteditor I used to first learn python automatically indents the code correctly. Jupyter notebooks does not

This error resulted from having the indents off in my code. Quick fix one I realized the "else" was the syntax error

File "", line 8

# else:
   ^

SyntaxError: invalid syntax

E9 No module named sets

ModuleNotFoundError Traceback (most recent call last)

in ()

3

4 # import library

----> 5 from sets import Set

6 SetA = Set(['Red', 'Blue', 'Green', 'Black'])

7 SetB = Set(['Black', 'Green', 'Yellow', 'Orange'])

ModuleNotFoundError: No module named 'sets'

As per StackOverflow (Did google search for Python 3 no sets module and first place I went was Stack Overflow

I know you planned to put stuff in Piazza but I figured I'd try my default rather than search first and it worked

just needed to change command from Set to set which is now built into Python 3

E9) Dumb error. Needed to change for Python 3

---------------------------------------------------------------------------

TypeError Traceback (most recent call last)

in ()

1 with open("Colors.txt", 'rb') as open_file:

----> 2 print("Colors.txt content:\n" + open_file.read())

TypeError: must be str, not bytes

Book told me that python 3 need r rather than rb switch to avoid error.

E10) Yep another typo. Need to remember () for print() in Python 3

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(trig_values)?

Packed house most of the weekend. So working late. FT work. End of semester. Plus international move

Good problems.

E11) Big long error when editing images

---------------------------------------------------------------------------

ValueError Traceback (most recent call last)

in ()

----> 1 image3 = resize(image2, (30, 30), mode='nearest')

2 plt.imshow(image3, cmap=cm.gray)

3 print("data type: %s, shape: 5s" %

4 (type(image3), image3.shape))

C:\ProgramData\Anaconda3\lib\site-packages\skimage\transform_warps.py in resize(image, output_shape, order, mode, cval, clip,

preserve_range)

133 out = warp(image, tform, output_shape=output_shape, order=order,

134 mode=mode, cval=cval, clip=clip,

--> 135 preserve_range=preserve_range)

136

137 return out

C:\ProgramData\Anaconda3\lib\site-packages\skimage\transform_warps.py in warp(image, inverse_map, map_args, output_shape, order,

mode, cval, clip, preserve_range)

767 warped = _warp_fast(image, matrix,

768 output_shape=output_shape,

--> 769 order=order, mode=mode, cval=cval)

770 elif image.ndim == 3:

771 dims = []

skimage/transform/_warps_cy.pyx in skimage.transform._warps_cy._warp_fast (skimage\transform_warps_cy.c:2226)()

ValueError: Invalid mode specified. Please use constant, edge, wrap, reflect or symmetric.

First step to solve. Read through quickly

########################################################################

Was it straightforward to install Python and all of the libraries?

########################################################################

Yes. Python, pip and related support systems in Anacondan required updates based on a warning message in Command Prompt

Followed instructions to update PIP. Everything else was up-to-date (See aabove)

Accidentally tried to install from wrong folder at first. Needed to ensure was in the correct folder using cd.. But minor issue.

Numpy, SciPi, and MatLab libraries all installed simply. Received confirmation that they worked (i.e., "Requirement already

satisfied:")

NOTE: SciPi did not require the complicated steps listed in instructions

C:\Program Files>pip install scipy

Requirement already satisfied: scipy in c:\programdata\anaconda3\lib\site-packages

NOTE:

In Windows 10 for install remember that people need to run the command prompt as an Administrator (Right Click)

########################################################################

Was the tutorial useful? Would you recommend it to others?

########################################################################

Useful. I suspect it would be difficult for someone who had never coded before and absolute beginner

or someone with limited coding experience. I would recommend a more updated version built for Python 3

unless the person was comfortable with some things not working. If so, this works fine.

########################################################################

What are the main lessons you've learned from this experience?

########################################################################

Keep learning shortcut keys so you don't have to use mouse (I love to do everything by keyboard

Sometimes if I just don't think about it, I figure it out quickly

Jupyter notebook is nice for starting out in some ways, but I prefer creating on a different text editor (ATOM)

and then running in command line. Why? It indents automatically.

Both use nice color-coded coded. Which helps in reading the code, although the colors aren't consistent

Strategies I use for proofing code and documents (start at the end and move backward, help simply the

process of cleaning code. Catch more errors this way.

Yes, it would be better to start earlier, but I'm making it work with the schedule of my life.

Still unclear how to do markdown errors. I kept looking for a good tutorial. I saw examples--but I'm not sure how to do it

yet.

About

Data Certificate Program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published