i mean delet the first row in your example ,it have strings "Name", "Age" and "City"
时间: 2023-08-17 20:04:43 浏览: 35
To delete the first row of a DataFrame in pandas, you can use the `drop` function with the `index` parameter set to 0. Here's an example based on your requirement:
```python
import pandas as pd
# Create a sample DataFrame
data = {'Name': ['John', 'Emma', 'Mike'],
'Age': [25, 28, 32],
'City': ['New York', 'London', 'Paris']}
df = pd.DataFrame(data)
# Delete the first row (header row)
df = df.drop(df.index[0])
print(df)
```
Output:
```
Name Age City
1 Emma 28 London
2 Mike 32 Paris
```
In this example, the `drop` function is used to remove the row at index 0, which corresponds to the first row of the DataFrame. The resulting DataFrame `df` will not include the first row.