pydbgen
pydbgen copied to clipboard
Error
#from pydbgen import pydbgen myDB=pydbgen.pydb() testdf= myDB.gen_data_series(data_type='data') print(testdf)
=====================
Traceback (most recent call last):
File "D:/python/Demopycharm/Test_month/z2020_01_month/Data-collect.py", line 40, in .seed() on instances is deprecated. Use the class method Faker.seed() instead.
Try force installing an older version of Faker
pip install Faker==2.0.5
add this import "from faker import Faker" and change "fake" to "Faker" Faker.seed(self.seed)
Can you expand on that last part @kvrameshreddy?
This is line 12-13
self.fake=Faker()
self.seed-seed
should change to waht?
I haven't faced any issue at line 12-13. my issue appeared at line 191-192. so i changed accordingly which worked for me.
Thanks but now I get:
NameError: name 'Faker' is not defined
Share the code changes you made
Here it is:
else:
import pandas as pd
num=int(num)
fake=self.fake
Faker.seed(self.seed)
lst = []
No worries, I am just using Faker directly
Add this line: "from faker import Faker" after pandas import then it will work fine