Questions tagged [python-dataset]

For questions relating to the Python `dataset` database package

For the Python dataset package: "In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files."

13 questions
2
votes
2 answers

Error: trying to redefine a primary key as non-primary key

I'm using the dataset library to attempt to back up a postgres database into an sqlite file. The code I'm running goes as follows: local_db = "sqlite:///backup_file.db" with dataset.connect(local_db) as save_to: with…
AnjoMan
  • 4,838
  • 4
  • 20
  • 28
2
votes
0 answers

Sqlalchemy Unconsumed column names using the dataset module

I am currently developing a game. This game store data in a sqlite database. I'm using dataset to manage the database, so I don't have to worry about sql queries. I have a method that access the database to update player info : def…
WayToDoor
  • 1,180
  • 9
  • 24
1
vote
2 answers

Change Dataset in Python

I have a dataset like this index data data_list label A i love pyhton. ['i love python.', [1,0] pyhton very useful. 'python very useful.'] B i like tea. tea ['i…
Sari Devi
  • 35
  • 3
1
vote
1 answer

How to generate a sine wave in python?

To generate a csv file where each column is a data of sine wave of frequency 1 Hz, 2 Hz, 3Hz, 4Hz, 5Hz, 6Hz and 7 Hz. The amplitude is one volt. There should be 100 points in one cycle and thus 700 points in seven waves.
Uday
  • 57
  • 12
1
vote
2 answers

Database insertion fails without error with scrapy

I'm working with scrapy and dataset (https://dataset.readthedocs.io/en/latest/quickstart.html#storing-data) which is a layer on top of sqlalchemy , trying to load data into a sqllite table as a follow up to Sqlalchemy : Dynamically create table…
user1592380
  • 34,265
  • 92
  • 284
  • 515
0
votes
1 answer

Pandas Creating New Column From Specific Column Problem

MY DATA (https://i.stack.imgur.com/7QNkp.png) Suppose that we have these kind of table, I would like to create new column as named 'Number'. if 'sentence' column contains the word 'fud', create column includes just the numbers that are in the column…
SPC
  • 21
  • 3
0
votes
1 answer

Loading data from Windows path

I have downloaded the Lock5Data from https://cran.r-project.org/web/packages/Lock5Data/index.html for windows r-release: Lock5Data_3.0.0.zip and tried to load a dataset from there in a python script (with ChatGPT's help) as below: import…
eisha enan
  • 53
  • 7
0
votes
0 answers

Loading/Reading a Video Dataset in Python

Is there any library in Python to load a video dataset just like we load an excel sheet as: pd.read_csv(), etc? I have a dataset which contains 20 subjects with each subject having 2 videos. The structure of the dataset is: Dataset/subject1/video1,…
NeuralAI
  • 43
  • 2
  • 10
0
votes
1 answer

How do I get the dataset module for Python to work when deployed?

Locally, I've created an empty sqlite database called earthquakes.db. Using the dataset Python library, I am able to freeze my results to a json file and everything works as expected. However, when deployed I get a long list of errors that…
Layne
  • 642
  • 1
  • 13
  • 32
0
votes
1 answer

Inspect many sqlite databases with python dataset module

Recently I used the python module dataset to manipulate and store information. As result, I have a collection of sqlite databases, let say file1.db, file2.db and so on. Moreover, each of the databases contains the same table. With dataset I can…
ricsca
  • 105
  • 1
  • 5
0
votes
1 answer

Python dataset updating fails on second pass

I wrote a little script that iterates a feed in a social network and publishes not yet published postings in another social network. I do that in 2 steps: first I read the feed of the first social network and put every post in my database, including…
tinaheidinger
  • 854
  • 1
  • 8
  • 21
-1
votes
2 answers

Unpack a list of dictionary and combine multiple values for distinct keys

I have following dictionary: [{'author__name': 'Alexandre Dumas', 'title': 'The Three Musketeer'}, {'author__name': 'Alexandre Dumas', 'title': 'The Count of Monte Cristo'}, {'author__name': 'Leo Tolstoy', 'title': 'Resurrection'}, {'author__name':…
chirag
  • 153
  • 2
  • 13
-2
votes
2 answers

Removing the ' from a list when indexing it

I have a list of numbers which I have in the following way (numbers are only an example): list = '1, 2, 3, 4, 5' I need them in an index format, so I do the following: format = [list] I now get it the following way: ['1, 2, 3, 4, 5'] However, I…