本文整理匯總了Python中pandas.core.frame.DataFrame.from_csv方法的典型用法代碼示例。如果您正苦於以下問題:Python DataFrame.from_csv方法的具體用法?Python DataFrame.from_csv怎麽用?Python DataFrame.from_csv使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas.core.frame.DataFrame
的用法示例。
在下文中一共展示了DataFrame.from_csv方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: value
# 需要導入模塊: from pandas.core.frame import DataFrame [as 別名]
# 或者: from pandas.core.frame.DataFrame import from_csv [as 別名]
def value(self):
global request_count
if self._value is None:
cache_path = os.path.join("quandl_cache", self.quandl_name + ".csv")
if os.path.exists(cache_path):
self._value = self._fix_missing(DataFrame.from_csv(cache_path))
elif os.path.exists(cache_path + ".fail"):
raise NoDataError("Previously failed")
elif self.quandl_disable:
raise NoDataError("Quandl Disabled due to rate limit")
else:
self._retrieve_from_quandl(cache_path)
return self._value
示例2: gabor_kernel
# 需要導入模塊: from pandas.core.frame import DataFrame [as 別名]
# 或者: from pandas.core.frame.DataFrame import from_csv [as 別名]
kernel = gabor_kernel(frequency, theta=theta, sigma_x=sigma, sigma_y=sigma)
kernels.append(kernel)
# imshow(np.real(kernel))
# show()
positives = []
negatives = []
for s in samples:
input_path = os.path.join(folder, s, 'input.tif')
expected_path = os.path.join(folder, s, 'expected.tif')
data_path = os.path.join(folder, s, 'data.csv')
input_image = Image.open(input_path)
expected_image = Image.open(expected_path)
data = DataFrame.from_csv(data_path)
a = np.asarray(input_image)
responses = np.empty((len(kernels), a.shape[0], a.shape[1]))
for i, k in enumerate(kernels):
response = responses[i, :, :] = np.hypot(convolve(a, np.real(k)), convolve(a, np.imag(k)))
#imshow(response)
scores = []
for i in range(9):
j = (i + 9) % 18
x_angle = angles[i]
y_angle = angles[j]
c = cos(x_angle)