[英]Storing Dataframe in ignite cache using cache.put()
I am using python to create a range query on spatial data and this is my first time dealing with ignite.我正在使用 python 创建空间数据的范围查询,这是我第一次处理点燃。 I have stored my data in a python's Dataframe but I do not know how to put it in the cache.我已将数据存储在 python 的 Dataframe 中,但我不知道如何将其放入缓存中。 I am only posting here because the majority of search result I find regarding this topic are related to Spark with ignite and are a bit too advance and different from my issue.我之所以在这里发帖,是因为我发现的大多数关于此主题的搜索结果都与带有 ignite 的 Spark 相关,并且有点过于超前并且与我的问题不同。 I only need to store the dataframe into the ignite cache I am not using Spark at all我只需要将数据帧存储到点燃缓存中我根本不使用 Spark
This is my code这是我的代码
import pandas as pd
data = pd.read_csv('green.txt', sep=",", header=None)
data.columns = ["time", "longitude", "latitude"]
data['Index'] = range(1, len(data) + 1)
data.head()
client = Client()
client.connect('127.0.0.1', 10800)
#Create cache
my_cache = client.create_cache('my cache')
#I need to add my Dataframe values like it is done for Hello World for each row
my_cache.put(1, 'Hello World')
Please feel free to close the question if it is not relevant如果不相关,请随时关闭问题
我完全不知道 Python 和数据帧,但是如果您可以将其保存为 CSV(即字符串),您可以轻松地将此 CSV 作为值放入缓存中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.