Is your feature request related to a problem? Please describe.
Currently when you use LoadCsv or LoadCsvFromString without supplying data types for each column, the code will try to guess the data types based on the data in the CSV file. This is good, but the problem is that the default type inference code only considers bool, float, DateTime, and string for column types. Sometimes the user may need another data type, such as int, long, or double (see issue 6347 for an example where someone had a problem with the float data type that was chosen by default) but not know the structure of the data ahead of time.
Describe the solution you'd like
I would like to be able to pass in my own custom type inference logic to override the default GuessKind implementation that is given in the library right now. If no custom guess type function is provided to the LoadCsv or LoadCsvFromString methods, then the code should work the same as it does today.
Describe alternatives you've considered
The alternative is to call LoadCsv/LoadCsvFromString with dataTypes set to an array filled with typeof(string) for each column in your data, and then run your logic on the DataFrame with all string type columns to convert the columns to the data types that make sense for each column based on the data that is in each column.
Additional context
I already have implemented a fix for this issue that I would like to merge in with a pull request.
Is your feature request related to a problem? Please describe. Currently when you use
LoadCsv
orLoadCsvFromString
without supplying data types for each column, the code will try to guess the data types based on the data in the CSV file. This is good, but the problem is that the default type inference code only considersbool
,float
,DateTime
, andstring
for column types. Sometimes the user may need another data type, such asint
,long
, ordouble
(see issue 6347 for an example where someone had a problem with thefloat
data type that was chosen by default) but not know the structure of the data ahead of time.Describe the solution you'd like I would like to be able to pass in my own custom type inference logic to override the default
GuessKind
implementation that is given in the library right now. If no custom guess type function is provided to theLoadCsv
orLoadCsvFromString
methods, then the code should work the same as it does today.Describe alternatives you've considered The alternative is to call
LoadCsv
/LoadCsvFromString
withdataTypes
set to an array filled withtypeof(string)
for each column in your data, and then run your logic on theDataFrame
with all string type columns to convert the columns to the data types that make sense for each column based on the data that is in each column.Additional context I already have implemented a fix for this issue that I would like to merge in with a pull request.