# -*- coding: utf-8 -*-
import datetime
import numpy
if __name__ == '__main__':
points = numpy.array([[datetime.date(2016, 10, 7), 150.0],
[datetime.date(2016, 10, 8), 760.0]])
print(points.min(axis=0))
"C:\Program Files\Python 3.6\python.exe" "D:/My Documents/PycharmProjects/tst/tst45.py"
[datetime.date(2016, 10, 7) 150.0]
Process finished with exit code 0
Traceback (most recent call last):
File "H:/My Documents/PyCharm/tst/tst38.py", line 14, in <module>
y1 = numpy.sqrt(x1)
AttributeError: 'int' object has no attribute 'sqrt'
# -*- coding: utf-8 -*-
import math
import sys
if __name__ == '__main__':
x1 = 1000000000000000000000000000000000000000000000000000000000000000000000
x2 = float(x1)
print(sys.getsizeof(x1))
print(sys.getsizeof(x2))
y1 = math.sqrt(x1)
y2 = math.sqrt(x2)
print(y1-y2)
def resource_path(relative):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative)
else:
return os.path.join(os.path.abspath("."), relative)
# ....
pixmap = QPixmap(resource_path("bg.jpg"))