For the quick data analysis type stuff you are trying to do, R is probably the most efficient language. It's optimized for this type of stuff. In fact, Pandas was built in Python simply to make it easier to use Python like R. Just do Text-to-Columns on your City column in Excel using the comma as a delimiter and then save your file as a CSV (e.g "test.csv" in the below code) Then, something like this (and I'm by no means an expert in R) is pretty quick: Code: #install packages used for easier reshaping and sorting of data install.packages("reshape2") install.packages("plyr") #load libraries library(reshape2) library(plyr) #read in your data data <- read.csv("test.csv", header = TRUE, strip.white=TRUE) #use melt function to take wide-format data and "melt" it to long format using the State as the ID and name the new output column "City" dat2b <- melt(data, id.vars=("State"), value.name = "City") #create new data frame with the columns you want and sort them alphabetically, first by state then by city newdata <- arrange(dat2b[, c(1,3)], State, City) #print new data frame newdata So, without all the fluff, you are looking at like three lines of actual code Code: data <- read.csv("test.csv", header = TRUE, strip.white=TRUE) dat2b <- melt(data, id.vars=("State"), value.name = "City") newdata <- arrange(dat2b[, c(1,3)], State, City)
awesome - gonna try this still need to figure out this in Python. Our team currently has a Python vs R rivalry going so team Python is trying to do everything in Python. Gonna try the split string thing posted last page also tomorrow
awesome that's cool that you can attach code in here like that Code: import tweepy from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener auth = OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_secret) api = tweepy.API(auth) class MyListener(StreamListener): def on_data(self, data): try: with open('/pythontwitter.txt', 'a') as f: f.write(data) return True except BaseException as e: print("error on_data: %s" % str(e)) return True def on_error(self, status): print(status) return True twitter_stream = Stream(auth, MyListener()) twitter_stream.filter(track=['#MCFC','LFC','Liverpool', 'MCFC', '#Liverpool', 'Manchester City'])
Btw, by habit I typically use Excel "Text-to-Columns" to split one column into multiple columns before I even import the data (like above). It's super quick, and with only one column to split, it's not a big deal. But let's say that you had a shit load of columns that were this way (so that manually splitting them all in Excel would be tedious) or didn't have access to Excel... You can do it really easily in R as well. Just requires one extra package to install, and then the above code would look like: Code: install.packages("reshape2") install.packages("plyr") install.packages("data.table") library(reshape2) library(plyr) library(data.table) data <- fread("test.csv", sep=",", sep2 = ",", header=TRUE) dat2b <- melt(data, id.vars=("State"), value.name = "City") newdata <- arrange(dat2b[, c(1,3)], State, City) newdata
heck yeah gonna try that then experiment with pandas version of melt http://pandas.pydata.org/pandas-docs/stable/generated/pandas.melt.html
looks like this can be used for a stackoverflow pretty impressed with the amount of people we have ITT
Huh, haven't looked at it yet but that could be really useful. I'm currently setting up a python fantasy football AI league, like computer chess kind of. Have everything set up to simulate leagues and I'm trying to get a write up done to let people start coding their AIs tomorrowish. It's just drafting this season so I pass available players and their adp, projection, and past stats to each AI to draft. Which by the way, anyone interested in joining? No pressure to be good, this season is more just an experiment. I can help with python too if people are interested in learning more. If anyone is I can post more details.
i use sql and vb a lot for my job, but i'd love to get java down, since most of our software is being migrated to java based applications. any advice? not sure if i should just jump straight into java or start with another language. it'd be self taught, so any resources would be great.
If you already know java it's easy. It's also deceiving because (especially with your first app) writing the app if half or less of the work. You'll then have to adjust it to work on so many different screens.
native android app development is mainly Java but not many people do native anymore. i'd go with c# (unity, xamarin, etc.) for mobile apps.
Understandable. Can you tell me this though? About what price range and time range could someone expect to have Version1 built for an app? And do you think it's smarter to build for Android and then copy/mirrow for an iOS build or vice versa or simultaneous builds?
Too variable to tell you without knowing what's in the app. And I don't do IOS or make any apps for sales so don't have much advice there either. If you are going paid app though ios might be better first, while free app might be reverse.
i want to make a weed delivery app because it becomes legal to sell in oregon on october 1st but i don't have the skills to make it, the money to pay someone to do it, or the experience to set up a delivery business
I mentioned functional programming earlier and heard that Swift is the shit for iOS stuff, but I've been writing a lot in Java lately and this would be a fun project (work in C# though). Also I'm still new to the development world and have too many interests. Best to probably sharpen my skills in a particular area for marketability before doing every fun thing I can think of.
matplotlib is the shit by the way. I mostly use gnuplot to make plots but I have been transitioning to matplotlib/python. You can make excel charts just look like straight up shit when you can master either of these two tools. Gnuplot is extremely handy if you need to plot millions of records or to do basic manipulation on columns. I honestly try to use excel as little as possible,I mostly have it open as a calculator or a unit converter.
seems relatively simple. also, there's an iOS app called "swifty" that's a daily lesson kind of teaching app for swift. seems like a good starter.
any help plz? Is this a good question for stackoverflow? I feel like they will be mean to me asking this. Loops with lists may not even be the best title idk. I only had 4 hours of sleep last night so I cannot think anymore today. http://stackoverflow.com/questions/31527116/python-loop-with-lists I feel dumb asking questions :/
i'm also working on a 'python fantasy football league.' it is a long-term project. i basically am building an entire world, i.e. like an ncaa dynasty sort of game, with fake players, but have not started working on the game engine yet
IMO just as a first step: in main, you probably want to check to see if the meeting is full / has been set yet for the given dates. If you have the green light, then run: def organize_meetings() which will contain the logic for randomizing all that shit, probably with for and while loops, which will repeatedly call def send_meeting_request() every time it populates/sends an individual meeting. Then go to sleep and in the morning figure out the logic behind organize_meetings.
I think people are generally helpful and not dickish when they understand what you are after. In this case you might explain that the current code can be used to email the single recipient with a single location in mind (even if it seems obvious to you) and then flesh out this end goal of random distribution. What does that really mean? Given that you have a list of 8 recipients and 4 locations is the idea to have 2 of them assigned to one of the 4 possible locations all day starting @ 8 during the range specified? It's a little unclear imo
its like building a model of the taj mahal out of toothpicks. i just built an algorithm that allows the AI to search by location. So the AI can calculate the distance between all ~3000 cities in the database, given the lat/lon coordinates of 2 points. That is going to help me with "Spring Scouting Camps", where recruits in the area show up and you can add them to your scouting list -- vs recruits that you seek out deliberately by scouting their high school ..... and how they respond to you based on distance/prestige/academics .... etc I actually have schools categorized. "State" "HBCU" "Mormon" "Baptist" "Private." Recruits have flags like "WillAttendMilitarySchool" and "PrefersCloseToHome." So it is what you'd call an incredibly "data rich environment." it is 51,000 lines of python code at this point. i'm still trying to develop the concepts, like how modeling of recruiting is supposed to work. How to scout, how to recruit, different actions that "Coaches" can take.
fgt This isn't a code-writing or tutorial service; do some research and put a little effort into writing this yourself. – jonrsharpe1 min ago f my life,
Yeah, I don't have any monetization plans yet at least. It will all be open source for the first season.
Walt you sound like me about a year ago. I'm still new and wanting to learn, but I was freaked out at how everyone seemingly knew so much more than I did and how in the hell could I learn enough to become a good programmer. Hopefully that feeling passes, but a big part is kind of learning how to learn. Stackoverflow can be a frustrating resource like you're finding out if you aren't crystal clear on your problem, but 95% of the time I need to figure out something at work I can usually find enough of an answer through google.
Plus that shit *never* goes away. You always don't know enough, even when you know what you are doing, if this is what you do professionally. Nature of the beast.
I haven't really dug into it a whole lot to be honest, but I'm pretty sure iOS doesn't support Flash. Here are a list of the SDK contents: https://en.wikipedia.org/wiki/IOS_SDK#SDK_contents
Very true. My boss is cool with me spending an hour or less a day doing coursework/non-work learning stuff so that makes me feel a little better. Just have to stay motivated to learn.
This. The easy part is looking up the answers. Its when you know what questions to actually ask and look for that you start to really understand the concepts. That, and applying it to actual applications. The hard part, imo, is landing the job (once you're in you're golden if you have a basic grasp and can use resources like StackOverflow). I hate coding interviews, but I have bad anxiety so maybe it's just me.
thats how it is with me/our team plus i'm really competitive and really hard on myself when i dont know something technically. I've been spending about 15 hours a week outside of work learning stuff
This is my issue. I love learning but if I have nothing to apply it to it just doesn't stick. I think one of the best things you can do if you can't keep learning on the job is to start contributing to open source projects on github.
don't feel bad, first time I asked a question on stack overflow I got HAMMERED learned my lesson quickly
reminding myself for tomorrow for this and to save this link https://blog.udemy.com/python-while-loop/
Just a heads up, I don't think codeacademy offers courses on Java. JavaScript and Java are two different languages. JavaScript is a lot more front-end oriented.