Inspect before you transform
searches.dtypes lists each column's data type. searches.info() prints column types and non-missing counts; it returns None, so use it for inspection rather than saving it as your answer.
Inspect column types and numeric summaries, then rename columns without changing their values.
Step 1 of 3 · Learn
searches.dtypes lists each column's data type. searches.info() prints column types and non-missing counts; it returns None, so use it for inspection rather than saving it as your answer.
describe() returns count, mean, sample standard deviation, minimum, quartiles, and maximum for numeric columns. Missing values are excluded from these statistics.
| index | score |
|---|---|
| 0 | 10 |
| 1 | 20 |
| 2 | 30 |
| index | score |
|---|---|
| count | 3 |
| mean | 20 |
| std | 10 |
| min | 10 |
| 25% | 15 |
| 50% | 20 |
| 75% | 25 |
| max | 30 |
Pass a dictionary of old and new names to rename(columns=...). Assign the returned DataFrame to keep the renamed result without changing the source table.
| index | name | score |
|---|---|---|
| 0 | Ari | 10 |
| 1 | Bo | 20 |
| 2 | Cam | 30 |
| index | name | points |
|---|---|---|
| 0 | Ari | 10 |
| 1 | Bo | 20 |
| 2 | Cam | 30 |
Return the numeric summary of response_ms from searches as a one-column DataFrame using describe(). Keep all eight statistic rows in their default order and preserve their labels as the index. Save it as result.
Loading Python and Pandas…
Run the code to see DataFrame results here.