Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45a7e89

Browse files
committed
Code for data science.
1 parent5d049a2 commit45a7e89

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

‎data-science/exp.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
importrandom
2+
importre
3+
importsys
4+
5+
tweet= {
6+
"user":"jwasham",
7+
"text":"Data Science is Cool",
8+
"retweet_count":100,
9+
"hashtags": ["#data","#science","#datascience"]
10+
}
11+
12+
tweet_keys=tweet.keys()# list of keys
13+
tweet_values=tweet.values()# list of values
14+
tweet_items=tweet.items()# list of (key, value) tuples
15+
16+
print(tweet_items)
17+
print(sys.version)
18+
19+
up_to_ten=list(range(10))
20+
random.shuffle(up_to_ten)
21+
print(up_to_ten)
22+
23+
lottery_numbers=list(range(60))
24+
winning_numbers=random.sample(lottery_numbers,6)
25+
print(winning_numbers)
26+
27+
print(random.choice(range(10)))
28+
29+
print("=================")
30+
31+
print(re.match("a","cat"))
32+
print(re.match("ca","cat"))
33+
print(re.search('mo','remote'))
34+
print(re.split('[0-9]','R5D4'))
35+
print(re.sub('[0-9]','x','R2D2'))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp