Python 썸네일형 리스트형 How to plot a graph : mathplotlib library In matlab, it is very easy to plot a graph. However, in python, you need to know which library do I have to import before plotting the graph. In python, mathplotlib library supports plotting a graph like matlab. Here is an example. Enjoy! import numpy as np import math import matplotlib.pyplot as plt x = range(0, 100) # x-axis (index) y = np.zeros(100) # y-axis (value) for i in range(0, 100): y[.. 더보기 [NYU depth] How to read NYU depth dataset in python NYU depth v2 dataset can be downloaded from http://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html They provide images and corresponding depth-map (aligned and in-painted) for training and testing. The data is stored in the format of mat. The following code shows how to read the images and corresponding depth-map in python. Enjoy. // CODES ////////////////////////////////////// import skimage.i.. 더보기 How to write values in csv files * 파이썬에서 csv 파일 쓰기 *** Assume you want to write numbers from 1 to 8 along the first column of a csv file; // CODE /////////////////////////// import csv fp = open('/home/test.csv','w') // csvWriter = csv.writer(fp, lineterminator = '\n') for i in range(1,9): csvWriter.writerow([i]) fp.close() 더보기 How to read values from csv files * 파이썬에서 csv파일 읽기 *** Assme you have test.csv file that stores some values; You can read the values in python using the following example code // CODE //////////////////////////////////// import tensorflow as tf import numpy as np import skimage.io as io import csv import os def get_csv_reader(filename, delimiter): reader = [] if not os.path.isfile(filename): print("No such file or directory!") e.. 더보기 이전 1 2 3 4 다음