Hey it’s me again…
I have a little question about characters amount when asking for ‘text’ and ‘numerical’ sdtypes. How can I enforce the number of characters ? Let’s say that my numerical should be 9 digits I know that there i sa work around with a contraint where I ask number > 100 000 000. But when it comes down to text I read that faker could use the number of characters or something. I guess it’s a feature request ? I’ll let you decide !
Thanks ![]()
Is this for generating data from scratch or for generating synthetic data from example data?
The easiest way in SDV to do this is probably by using the ScalarRange Constraint as you were implying:
If a column is full of numerical values, honestly it’s generally ideal to keep things that way throughout your entire synthetic data pipeline instead of having to convert to a string just to do lexical analysis ![]()
Also, this constraint is a bit more flexible because you could express a pattern to accept values that have 3 place values (for example) but must be less than 600!
It’s for from scratch data generation ![]()
I can’t use scalar range on ‘text’ sdtypes can I ?
I’ll try something for 6 place values. Thanks for the help!
Hi @epicvu and @Srini jumping in here –
If you are creating data from scratch, then I believe you’re using the DayZSynthesizer? While DayZ does not support constraints, you should be able to achieve this in other ways:
- For numerical data, use add_numerical_bounds to set a lower and upper bound that are 9-digits long.
- For categorical data, use set_category_values to provide a list of all possible valid values
- For other types of data (such as
text) we don’t yet provide a deep integration with Faker. However, I have a filed a feature request for it here and have provided a workaround in that thread.
Does that answer your question?
BTW since we now have a dedicated feature request for the DayZ/Faker integration, I will update this issue to mention that it is a duplicate. But do feel free to continue replying here if you need any help implementing the workaround. Thanks.
Thanks a lot! It sure answered all the questions ![]()
Also thank you for the work around I think I made something similar to try.
Have a nice day!