202010-08 tensorflow之读取jpg图像长和宽实例 有时需要读取jpg图像的长和宽,tensorflow提供了很好的支持直接上示例decode_jpeg_data=tf.placeholder(dtype=tf.string)decode_jpeg=tf.image.decode_jpeg(decode_jpeg_data,channels=3)image_data=tf.gfile.FastGFile("C:/Users/shenwei/Desktop/timg.jpg",'rb').read()print(len(image_data))withtf.Session()assess:image=sess.run(decode_jpeg,feed_dict={decode_jpeg_data:image_data})print(image.shape... 继续阅读 >
202009-29 python 数据分析实现长宽格式的转换 我就废话不多说了,大家还是直接看代码吧!#encoding=utf-8importnumpyasnpimportpandasaspd#长宽格式的转换#1data=pd.read_csv('d:data/macrodata.csv')print'data:=\n',dataprint'data.to_records():=\n',data.to_records()print'data.year:=\n',data.yearprint'data.quarter:=\n',data.quarterperiods=pd.PeriodIndex(year=data.year,quarter=data.quarter,name='date')print'periods:=\n',periodsdat... 继续阅读 >