Closed hugobowne closed 8 years ago
Use do_eval = False
in test_function("type", ...)
. np.genfromtxt(file , delimiter = ",", names = True , dtype = None)
is not the same two times, even with numpy.testing.assert_equal
.
import numpy as np
np.testing.assert_equal(np.genfromtxt(file , delimiter = ",", names = True , dtype = None), np.genfromtxt(file , delimiter = ",", names = True , dtype = None))
Throws an AssertionError
.
thanks. it works now: but aren't we testing type(data) == type(data), not that the arrays are equal?
type(data)
is an argument of print()
, so you're testing what you're suggesting with test_function("print", ...)
. With test_function("type", ...)
, you're testing the argument of type(...)
, which is data
.
It will be live on Monday. I've tested your SCT with the fix and it worked so you don't have to change that. I'm currently at home and can't seem to reach the VPN here, which I need to push to production. Once in the office again on Monday I'll push it first thing in the morning :-).
gr8 thx sounds good to me have a nice weekend!!
Your SCT should work now
Woooops those last two comments of mine should've been on #36. This issue was closed, right?
https://campus.datacamp.com/courses/importing-data-into-python/introduction-and-flat-files?ex=13
(issue w/ line 7)
the weird thing is that the exact same SCT works perfectly in this exercise:
https://campus.datacamp.com/courses/importing-data-into-python/introduction-and-flat-files?ex=16