移除无用内容
This commit is contained in:
parent
128f12e1d5
commit
8b85ede45c
|
|
@ -50,14 +50,14 @@ public class Excel2Prompt
|
|||
var nonNullData = columnData.Where(value => value != null).ToList();
|
||||
var missingValues = columnData.Count - nonNullData.Count;
|
||||
var uniqueValues = nonNullData.Distinct().Count();
|
||||
var sampleValues = nonNullData.Take(3).Select(value => value.ToString().Replace("\n"," ")).ToArray();
|
||||
var sampleValues = nonNullData.Take(5).Select(value => value.ToString().Replace("\n"," ")).ToArray();
|
||||
|
||||
// 自动识别数据类型
|
||||
var dataType = GetColumnDataType(nonNullData);
|
||||
|
||||
var prompt = $"- Column '{column.Replace("\n", " ")}'\n" +
|
||||
$" - Type: {dataType}\n" +
|
||||
$" - Sample values: ['{string.Join("', '", sampleValues)}']";
|
||||
var prompt = $"- Column '{column.Replace("\n", " ")}'" +
|
||||
$" - Type: {dataType}" +
|
||||
$" - Sample values: ['{string.Join("','", sampleValues)}']";
|
||||
//$" - Unique values: {uniqueValues}\n" +
|
||||
//$" - Missing values: {missingValues}\n";
|
||||
|
||||
|
|
@ -70,11 +70,11 @@ public class Excel2Prompt
|
|||
|
||||
private static string GetColumnDataType(List<object> data)
|
||||
{
|
||||
bool isInt = true;
|
||||
bool isLong = true;
|
||||
bool isDouble = true;
|
||||
bool isDateTime = true;
|
||||
bool isBool = true;
|
||||
var isInt = true;
|
||||
var isLong = true;
|
||||
var isDouble = true;
|
||||
var isDateTime = true;
|
||||
var isBool = true;
|
||||
|
||||
foreach (var item in data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue