KeyError: 'C:\\Users\\Administrator\\Desktop\\weather_nominal.csv'
时间: 2023-11-17 17:02:25 浏览: 114
根据提供的引用内容,无法回答你的问题。但是从错误信息来看,这个错误通常是由于代码中使用了不存在的键值或列名导致的。可能是你的代码中使用了'C:\\Users\\Administrator\\Desktop\\weather_nominal.csv'这个文件的某个键值或列名,但是该文件不存在或者文件路径不正确。你可以检查一下文件路径是否正确,或者检查一下代码中是否有拼写错误或者其他语法错误。如果你能提供更多的代码和上下文信息,我可以更好地帮助你解决这个问题。
相关问题
SET @batch_date = '20230222'; set @partition_name=concat('p',@batch_date); set @stat=concat('alter table tb_bond_price_comparision_reuslt truncate partition ',@partition_name); prepare stmt from @stat; execute stmt; insert into tb_bond_price_comparision_reuslt select distinct org.ISIN, mul.Broker_Yield, mul.Broker_Price, org.MARKET_PRICE, case when org.MARKET_PRICE > mul.Broker_Price then 'Broker Price' else 'BVAL' end as MARKET_PRICE_MIN, org.TRADE_REF, case when org.MARKET_PRICE > mul.Broker_Price then mul.Broker_Price else org.MARKET_PRICE end as MARKET_PRICE_MIN, case when org.MARKET_PRICE > mul.Broker_Price then mul.Broker_Price * org.NOMINAL_AMT else org.MARKET_PRICE * org.NOMINAL_AMT end as MARKET_VALUE_MIN, org.dt from tb_trade_blotter_op_sec org left join tb_bond_price_comparision_trade_blotter_op_sec_mul mul on org.TRADE_REF = mul.TRADE_REF and org.ISIN = mul.ISIN and org.dt = mul.dt where org.dt = @batch_date转换为mybatis执行语句以及生成service层代码
首先,将SQL语句转换为MyBatis执行语句:
```sql
<insert id="insertBondPriceComparisonResult" parameterType="string">
SET @batch_date = #{batchDate};
SET @partition_name = CONCAT('p', @batch_date);
SET @stat = CONCAT('ALTER TABLE tb_bond_price_comparision_reuslt TRUNCATE PARTITION ', @partition_name);
PREPARE stmt FROM @stat;
EXECUTE stmt;
INSERT INTO tb_bond_price_comparision_reuslt
SELECT DISTINCT
org.ISIN,
mul.Broker_Yield,
mul.Broker_Price,
org.MARKET_PRICE,
CASE
WHEN org.MARKET_PRICE > mul.Broker_Price THEN 'Broker Price'
ELSE 'BVAL'
END AS MARKET_PRICE_MIN,
org.TRADE_REF,
CASE
WHEN org.MARKET_PRICE > mul.Broker_Price THEN mul.Broker_Price
ELSE org.MARKET_PRICE
END AS MARKET_PRICE_MIN,
CASE
WHEN org.MARKET_PRICE > mul.Broker_Price THEN mul.Broker_Price * org.NOMINAL_AMT
ELSE org.MARKET_PRICE * org.NOMINAL_AMT
END AS MARKET_VALUE_MIN,
org.dt
FROM tb_trade_blotter_op_sec org
LEFT JOIN tb_bond_price_comparision_trade_blotter_op_sec_mul mul
ON org.TRADE_REF = mul.TRADE_REF AND org.ISIN = mul.ISIN AND org.dt = mul.dt
WHERE org.dt = @batch_date;
</insert>
```
然后,生成对应的Service层代码:
```java
@Service
public class BondPriceComparisonResultServiceImpl implements BondPriceComparisonResultService {
@Autowired
private BondPriceComparisonResultMapper bondPriceComparisonResultMapper;
@Override
public void insertBondPriceComparisonResult(String batchDate) {
bondPriceComparisonResultMapper.insertBondPriceComparisonResult(batchDate);
}
}
```
> library(rsample) > library(tidymodels) > library(recipes) > > # Create preprocessing recipe > diamonds_recipe <- recipe(price ~ ., data = diamonds_train) %>% + step_boxcox(all_numeric()) %>% + step_dummy(all_nominal(), -all_outcomes()) Error in step_boxcox(., all_numeric()) : could not find function "step_boxcox"
这个错误的原因是因为`step_boxcox()`函数在`recipes`包中已经被移除了。现在,你需要使用`step_YeoJohnson()`函数来替换它。修改后的代码如下:
```
library(rsample)
library(tidymodels)
library(recipes)
# Create preprocessing recipe
diamonds_recipe <- recipe(price ~ ., data = diamonds_train) %>%
step_YeoJohnson(all_numeric()) %>%
step_dummy(all_nominal(), -all_outcomes())
```
这将使用Yeo-Johnson变换来预处理数值变量,而不是Box-Cox变换。请注意,这可能会对你的模型产生不同的影响,因为两种变换的效果会有所不同。
阅读全文