Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: syntax=python | |
def removeDuplicates(nums): | |
""" | |
:type nums: List[int] | |
:rtype: int | |
""" | |
if len(nums) < 2: | |
return len(nums) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: syntax=python | |
# remove punctuation | |
re.sub(r'[^\w\s]','',string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: syntax=python | |
# In Python 2.6+, you could use io.open() that is default (builtin open()) on Python 3: | |
import io | |
with io.open("filename.txt", 'r') as file: | |
# count lines of file | |
num_lines = sum(1 for line in file) | |
# get N lines |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number,Alias,"Please, tell me about yourself. What interest you? Do you have any hobbies?",What do you expect to learn in Information Visualization? How do expect to use what you learn?,IVIS,Stats,Math,Art,User,Prog,Graphics,HCI,UX | |
1,Aldor,I have great interest in visual design and filmmaking. ,"I expect to learn the why, how and what of the visualization of data. Thinking of the why in order to create meaningful visualizations and the how & what to learn the programming and design that is involved. ",7,3,3,9,6,2,1,4,8 | |
2,Aragorn,"I have been an aviation enthusiast since I was a kid, although I do not hold a pilot's license (yet). I enjoy cooking and I try to follow a healthy lifestyle with regular physical activity, such as cycling, running or team sports, mostly football. I have developed an increasing interest in all sorts of water-sports over the past few years, mostly in free-diving and surfing. I have an appreciation for all art forms but I am far from being an art-savvy. ","I am working on several perso |