sw = df['wind Speed'].tail(30).round(2)获取倒数30-60行怎么改
时间: 2024-02-09 09:11:31 浏览: 20
如果想获取倒数30-60行的 `wind Speed` 列并且保留两位小数,可以使用以下代码:
```
sw = df['wind Speed'][-60:-30].round(2)
```
其中 `[-60:-30]` 表示从倒数第60行到倒数第31行(不包括倒数第30行)。注意,在使用负数索引时,需要保证负数的绝对值不大于数据总行数。
相关问题
Error in fitFDistRobustly(var, df1 = df, covariate = covariate, winsor.tail.p = winsor.tail.p) : statmod package required but is not installed
这个错误提示的意思是需要安装`statmod`这个R包才能运行`fitFDistRobustly`函数。你可以尝试使用以下代码安装该包:
```
install.packages("statmod")
```
如果你已经安装了该包但仍然出现这个错误,请确认该包是否已经正确加载。你可以使用以下代码加载该包:
```
library(statmod)
```
如果仍然无法解决问题,请检查R版本是否过低。
class Queue: def __init__(self, limit=10): self.data = [None] * limit self.head = -1 self.tail = -1
def is_empty(self): return self.head == -1 def is_full(self): return (self.tail + 1) % len(self.data) == self.head def enqueue(self, val): if self.is_full(): raise Exception("Queue is full") if self.head == -1: self.head = 0 self.tail = (self.tail + 1) % len(self.data) self.data[self.tail] = val def dequeue(self): if self.is_empty(): raise Exception("Queue is empty") val = self.data[self.head] if self.head == self.tail: self.head = -1 self.tail = -1 else: self.head = (self.head + 1) % len(self.data) return val
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)