Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
"""
Get quotesdf
@author: Dazhuang
"""
import requests
import re
import json
# -*- coding: utf-8 -*-
"""
Get djidf
@author: Dazhuang
"""
import requests
import re
import pandas as pd
# -*- coding: utf-8 -*-
"""
Get quotesdf
@author: Dazhuang
"""
import requests
import re
import json
# -*- coding: utf-8 -*-
"""
Get djidf
@author: Dazhuang
"""
import requests
import re
import pandas as pd
import collections
import copy
s = "I am a test sentence and I am very cute."
s_list = s.split()
s_list_backup = copy.deepcopy(s_list)
[s_list.remove(item) for item in s_list_backup if item in ',.!"']
print(collections.Counter(s_list))
s_list = s.split()
Take a look at the DataFrames changes.
Suppose there is a DataFrame here,
>>> aDF
name pay
0 Mayue 3000
1 Lilin 4500
2 Wuyun 8000

# -*- coding: utf-8 -*-
"""
create DataFrame object
@author: Dazhuang
"""
import pandas as pd
music_data = [("the rolling stones","Satisfaction"),("Beatles","Let It Be"),("Guns N' Roses","Don't Cry"),("Metallica","Nothing Else Matters")]
music_table = pd.DataFrame(music_data)
music_table.index = range(1, 5)
@canwe
canwe / StartupBean.java
Created April 5, 2018 10:16 — forked from mojavelinux/StartupBean.java
A sample CDI extension for eagerly instantiating @ApplicationScoped beans annotated @startup
@ApplicationScoped
@Startup
public class StartupBean
{
@PostConstruct
public void onStartup()
{
System.out.println("Application starting up.");
}
}
@canwe
canwe / latency.txt
Created February 18, 2018 07:16 — forked from andriisoldatenko/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@canwe
canwe / maven-appassembler-program-example.xml
Created February 16, 2018 17:37 — forked from drmalex07/maven-appassembler-program-example.xml
Example configuration for maven appassembler plugin. #maven #maven-appassembler
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>assemble-script</id>
<phase>package</phase>
<goals><goal>assemble</goal></goals>
<configuration>