We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
더미데이터 생성 파이썬 코드 추가합니다.
import random from datetime import datetime, timedelta import pandas as pd from faker import Faker from sqlalchemy import create_engine username = '{username}' password = '{password}' host = '{host}' port = 3306 db_name = '{db_name}' engine = create_engine(f"mysql://{username}:{password}@{host}:{port}/{db_name}?charset=utf8mb4") conn = engine.connect() fake = Faker() # locale 정보 설정 Faker.seed() data = { 'concert_name': [], 'concert_date': [], 'ticket_open_time': [], 'ticket_end_time': [], 'venue_seq': [], 'artist_seq': [], 'cancelled_flag': [], 'create_datetime': [] } for i in range(1, 1000001): now = datetime.now() random_num = random.uniform(1, 1000) ticket_open = now + timedelta(days = random_num) ticket_end = ticket_open + timedelta(days = 7) data['concert_name'].append(fake.name() + ' Concert') data['concert_date'].append(ticket_end + timedelta(days = 30)) data['ticket_open_time'].append(ticket_open) data['ticket_end_time'].append(ticket_end) data['venue_seq'].append(random_num) data['artist_seq'].append(random_num) data['cancelled_flag'].append(0) data['create_datetime'].append(now) df = pd.DataFrame(data) print(df) df.to_sql(name="concert", con=engine, if_exists='append', chunksize=1000, method='multi', index=False)
Sorry, something went wrong.
ZhenxiKim
gutenLEE
No branches or pull requests
Description
The text was updated successfully, but these errors were encountered: