Populate mysql table with random data in python

2024/11/23 12:12:14

How can create a mysql table in python and then populate it with random data.I want around 10000 rows and integer values will do work.

Answer

Your question is not very clear (want to generate a table in python AND fill it with random data?).

Well, if you want to do it by hand, generate the random number using random. Check it out! Do a mini-logic with a cycle to fill your rows (if you don't know how, search in this forum or ask.).

Also, check here (I haven't used it!): psyert

Mini-note: your questions have been systematically downrated. Please, check the FAQ of StackOverflow and see how to do a proper elegant question. If English is not your native language, don't worry, but at least use the punctuation and get help from an online translator.

https://en.xdnf.cn/q/120639.html

Related Q&A

I want to change a tuple into string without joining it in python. How could I do that? [duplicate]

This question already has answers here:Convert a list to a string without join(5 answers)Closed 3 years ago.For Example: I want to change t=(a, b, c) to s=a, b, c

Convert several YAML files to CSV

I am very new to Python and have several YAML files that I need to convert into csv. These are notes, comments and emails that came from our CRM (Highrise). I ONLY need the Notes and Comments, not the …

Python split unicode characters and words

Im running a data science project and i need your help.My string is:string = 🎁Testand I expect that output:s1 = 🎁s2 = Test

How to run two Flask discord.py bots in the same repl.it project?

I am using repl.it to run two bots in the same repl and Im using imports as a I saw in other stackoverflow questions. print(This will be the page where all bots will be made.) import os import bot1 imp…

build a perfect maze recursively in python

I have this project to build a perfect maze recursively by using python. I have a MyStack class which creates a stack to track the path that I go through. And a Cell class which represent each square w…

How do I select random text on screen [closed]

Closed. This question needs debugging details. It is not currently accepting answers.Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to repro…

Conditional return with no else [duplicate]

This question already has answers here:Python Ternary Operator Without else(9 answers)Closed 10 months ago.Im try to do something like that in Python:return None if a is NoneInstead of having:if a is N…

Finding the position of an item in another list from a number in a different list

Developing on my previous question Im wondering whether there is a way to have an element in a list and find that position in another list and return what is in the position as a variable. for example:…

Why am I getting array instead of vector size? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.Closed 3 years ago.Improve…

Sending Email attachment (.txt file) using Python 2.7 (smtplib) [duplicate]

This question already has answers here:How to send email attachments?(21 answers)Closed 9 years ago.So Im trying to send a .txt file as an attachment and I cant find the right code to work. Here is my…