Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Pandas is a Python data analysis library.
3
votes
1
answer
84
views
Creating names from URLs
import pandas as pd
df = pd.DataFrame([['www.pandas.org','low'], ['www.python.org','high']],
columns=['URL','speed'])
print(df.head())
df['Name'] = df['URL']
print(df.head())
#set Name based … on substring in URL
df.loc[df['Name'].str.contains("pandas", na=False), 'Name'] = "PANDAS"
df.loc[df['Name'].str.contains("python|pitone", na=False), 'Name'] = "PYTHON"
print(df.head()) …
3
votes
2
answers
289
views
rolling quarterly mean
import pandas as pd
import numpy as np
import time
date_range = pd.date_range(start="2020-01-01", end="2023-12-31", freq='D')
np.random.seed(0)
volume_data = np.random.randint(100, 1000, size=len(date_range …