我真的很难弄清楚如何将我的AWS Dynamodb数据库值移动到pandas dataframe中。我的数据并不是特别大(100,000行)。我将数据放入s3中,然后为了简单起见下载了它。我试图使用boto3和S3Fs将数据导入pandas frame,但没有成功,因此现在我只好在创建了一个与S3的管道之后直接下载文件。输出以以下格式呈现,但pd.read_JSON、pd.read_csv和pd.read_table似乎无法理解。
{"id":{"s":"3115136104"},"created":{"s":"Wed Mar 25 15:15:35 +0000 2015"},"location":{"s":"Dover, Kent"},"description":{"s":"#TrafficandWeather information from the #PortofDover - follow for regular round the clock updates. NOTE: we are not always able to respond to queries"},"friends_count":{"n":"66"},"name":{"s":"Port of Dover Travel"},"URL":{"s":"doverport.co.uk/weather/"},"statuses_count":{"n":"11062"},"lang":{"s":"en"},"followers_count":{"n":"11517"}}
这显然是JSON格式的,但因为它将每个行项目分解成一个没有键的字典。我完全不知道如何让pandas读取这个文件。
我的问题是,最简单的方法是什么,可以将整个dynamodb表格导入Pandas中,假设有一些空值?请注意,我已经尝试了很多种方法,但是没有任何进展,所以我没有包含任何通用代码。