last day (121 days later) » 

10:05 AM
Hey Shubham!
 
Hi Geordi :)
Can you please explain how would you like to sort the dataframe columns, i m not sure that i understand your last comment?
 
This is so great, thank you for your help with this today. So, my index for 'table' is the series of datetimes for each hour:
100 10000 2015 23 3 ... weak whos xchange yall year
hour ...
2021-02-13 07:00:00 0 0 0 0 0 ... 0 0 0 0 0
2021-02-13 08:00:00 0 0 1 0 0 ... 0 0 0 0 0
2021-02-13 09:00:00 0 0 0 0 0 ... 0 0 0 0 0
2021-02-13 10:00:00 0 0 0 0 0 ... 0 0 0 0 0
2021-02-13 11:00:00 1 0 0 0 0 ... 0 0 0 0 0
Oh, sorry. I;m not sure what the formatting is for this text service.
 
Just press CTRL + K after selecting the text to autoformat..
@GeordiAlm Glad i could help.
 
I'm essentially trying to do this: stackoverflow.com/questions/40111161/…
    C   B   D  A
0  16   5   1  1
1  45  30  10  5
2  60  40   5  2
3  40  15   7  4
 
So you want to consider single max value in the entire column?
Then sort the dataframe columns according to that max value, correct?
 
10:12 AM
but my index is a timestamp, and it looks like .index doesn't like the difference between int and date
yes, that's the goal!
 
give me a min i will check.
 
I got it to work by changing my index to an array of numbers (1-24), but that gets rid of my hour values.

No problem, thank you for your help with this!
 
can you try:
df.loc[:, df.max().sort_values(ascending=False).index]
Or may be with iloc:
df.iloc[:, np.argsort(df.max() * -1)]
 
Hmm, this worked for me, although I don't know why. Before, I had an extra hour column of datetime type, and maybe that was throwing the .index off?
The first solution that is*
df.dtypes
buy             int64
day             int64
sale            int64
doge            int64
dogearmy        int64
                ...
dogecoinarmy    int64
dogecoin        int64
dodgecoin       int64
dirt            int64
year            int64
Length: 116, dtype: object
df.dtypes
buy int64
day int64
sale int64
doge int64
dogearmy int64
...
dogecoin int64
dodgecoin int64
dirt int64
year int64
hour datetime64[ns]
Length: 117, dtype: object

- what I was using before I started again from scratch with your solution
 
You can set the hour column as index before using df.loc[:, df.max().sort_values(ascending=False).index]
 
10:25 AM
Right, I think that's what was happening before with it! As you can see I'm pretty new to python, so I'm beyond helpful for assistance like this! I appreciate you looking out for the noobs of the programming world =]
 
No problem..Its my pleasure helping you out :)
 
I'm grateful! Have a great night :)
 
You too!
 
 
7 hours later…
5:07 PM
@GeordiAlm
 
5:24 PM
Hey there!
@ShubhamSharma just figured out how to tag you! These interactions are helping me with my Stackoverflow etiquette, so I thank you for that!
 
Hi @GeordiAlm just give me few minutes i'll back shortly :)
 
5:41 PM
No problem!
 
6:04 PM
Hey, sorry to keep you waiting.
 
No problem at all! I'm very grateful you've been so kind to me this past day.
 
i thought there's only one string in per list in the column tweets..That's why i used .str[0]
@GeordiAlm :)
 
Ahh, I see!
 
Can you check:
df['tweets'].astype(str).str.extractall(r'(\w+)')[0]
 
will do! Checking now
 
6:06 PM
Sure let me know the results :)
 
So, right away,
```words = hourly_tweet_df['full_tweet'].astype(str).str.extractall(r'(\w+)')[0]```
gave me 62k results, before it was 308, so that's a good sign! Running "Remove stopwords and create frequency table" right now...
 
Take your time.
 
6:41 PM
Hey @GeordiAlm Its late here so i think i'll turn in..If you need any help just drop a message here and i will help you out in the morning..
 
Sounds good! Still running here. Next time I'll insert a time metric to see how long this process takes! Thank you and I will report back here when it's finished!
 
By the way how big is your dataframe?
 
The raw pull yielded 42k individual tweets in a 24hr timeframe
on the hashtag #dogecoin XD
 
I see.
.extractall is the expensive computation i guess it will take time.
 
That makes sense!
 
6:46 PM
See ya!
 

  last day (121 days later) »