How to insert pandas dataframe into Cassandra table?

1,696 views
Skip to first unread message

Daniel Hong

unread,
Oct 13, 2016, 3:06:18 PM10/13/16
to DataStax Python Driver for Apache Cassandra User Mailing List
I am trying to insert a pandas dataframe into a Cassandra table, however I haven't been able to find anything examples online on how to do that except INSERT INTO VALUES statements...Does anyone know how this can be done?

Adam Holmberg

unread,
Oct 17, 2016, 9:42:56 AM10/17/16
to python-dr...@lists.datastax.com
Can you provide your schema and sample application code for what you're trying?

On Thu, Oct 13, 2016 at 2:06 PM, Daniel Hong <daniel....@gmail.com> wrote:
I am trying to insert a pandas dataframe into a Cassandra table, however I haven't been able to find anything examples online on how to do that except INSERT INTO VALUES statements...Does anyone know how this can be done?

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.

Aaron Benz

unread,
Oct 17, 2016, 11:08:47 PM10/17/16
to python-dr...@lists.datastax.com
FYI - A while ago I was working on a package to make Cassandra and Pandas "easy" to use together (really for the Data Scientist). I called it "Caspanda"

I few people have helped keep it up to date, and we have some decent tutorials with it if you wanted to check it out. Reading from C* was pretty straight forward, and I did have some very basic examples working to write back to Cassandra, but alas, here it is: https://github.com/aaronbenz/caspanda

Honestly, one of my favorite parts about it was printing out the Cassandra tables in a way that reflected how data is actually stored as opposed to straight CQL table structures (particularly helpful for beginner NoSQL folks)

Best,
Aaron

To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsubscribe@lists.datastax.com.

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.



--

Noelia

unread,
Jan 26, 2017, 10:37:12 AM1/26/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi Aaron,

Thanks for creating caspanda!
However, the readme file does not explain how to save a dataframe to cassandra with caspanda.
If it is explained somewhere, would you be so kind as to point me to the explanation?
Otherwise, I would appreciate a simple example.

Thanks!!


On Tuesday, 18 October 2016 05:08:47 UTC+2, Aaron Benz wrote:
FYI - A while ago I was working on a package to make Cassandra and Pandas "easy" to use together (really for the Data Scientist). I called it "Caspanda"

I few people have helped keep it up to date, and we have some decent tutorials with it if you wanted to check it out. Reading from C* was pretty straight forward, and I did have some very basic examples working to write back to Cassandra, but alas, here it is: https://github.com/aaronbenz/caspanda

Honestly, one of my favorite parts about it was printing out the Cassandra tables in a way that reflected how data is actually stored as opposed to straight CQL table structures (particularly helpful for beginner NoSQL folks)

Best,
Aaron
On Mon, Oct 17, 2016 at 8:42 AM, Adam Holmberg <adam.h...@datastax.com> wrote:
Can you provide your schema and sample application code for what you're trying?
On Thu, Oct 13, 2016 at 2:06 PM, Daniel Hong <daniel....@gmail.com> wrote:
I am trying to insert a pandas dataframe into a Cassandra table, however I haven't been able to find anything examples online on how to do that except INSERT INTO VALUES statements...Does anyone know how this can be done?

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.

Emiliano Múgica

unread,
Jul 6, 2017, 3:50:28 PM7/6/17
to DataStax Python Driver for Apache Cassandra User Mailing List, no...@vicomtech.org
Noelia & Daniel

Do you guys ever found a way to do this?
Reply all
Reply to author
Forward
0 new messages