« first day (888 days earlier)      last day (1300 days later) » 
00:00 - 16:0016:00 - 00:00

12:08 AM
0
Q: Numpy trouble vectorizing certain kind of aggregation

Eric KaschalkI am having difficulty in vectorizing the below operation: # x.shape = (a,) # y.shape = (a, b) # x and y are ordered over a. # Want to combine x, y into z.shape(num_unique_x, b) # Below works and illustrates intent but is iterative z = np.zeros((num_unique_x, b)) for i in range(a): z[x[i],...

 
12:29 AM
0
Q: “Hangman” game in Python

Ilia_MochalovI have been using Python 3 to learn programming, and this is a very basic task, but I want to gain good programming patterns/habits at the very beginning. import sys import random words_list = ['russia', 'china', 'usa', 'canada', 'ghana'] #pre-made list of our words to guess accepted_input = ['...

0
Q: Python: Why does numpy least squares result diverge from using the direct formula?

DoleI want to calculate the least squares estimate for given data. There are a few ways to do this, one is to use numpy's least squares: import numpy np.linalg.lstsq(X,y)[0] Where X is a matrix and y a vector of compatible dimension (type float64). Second way is to calculate the result directly u...

0
Q: Color between the x axis and the graph in PyPlot

Randy BanksI have a graph that was plotted using datetime objects for the x axis and I want to be able to color beneath the graph itself (the y-values) and the x axis. I found this post Matplotlib's fill_between doesnt work with plot_date, any alternatives? describing a similar problem, but the proposed sol...

 
12:58 AM
0
Q: All rows within a given column must match, for all columns

JS.I have a Pandas DataFrame of data in which all rows within a given column must match: df = pd.DataFrame({'A': [1,1,1,1,1,1,1,1,1,1], 'B': [2,2,2,2,2,2,2,2,2,2], 'C': [3,3,3,3,3,3,3,3,3,3], 'D': [4,4,4,4,4,4,4,4,4,4], 'E'...

 
 
1 hour later…
2:08 AM
0
Q: Decided the order of the groupby output?

user7153After the groupby, the output order of the group is pre-decided. In the following case, the order is A, AAA, B, BBB. Is there a way to customize this order? I want to order to be AAA,A,BBB,B. I might want it in other orders as well. import pandas as pd import matplotlib as mpl import matplotl...

 
2:18 AM
0
Q: Labeling boxplot in seaborn with median value

user308827How can I label each boxplot in a seaborn plot with the median value? E.g. import seaborn as sns sns.set_style("whitegrid") tips = sns.load_dataset("tips") ax = sns.boxplot(x="day", y="total_bill", data=tips) How do I label each boxplot with the median or average value?

 
3:17 AM
0
Q: anaconda and manjaro-xfce4: the matplotlib and spyder cann't work

Hewen XuI use manjaro-xfce4 and anaconda to do my python work. But after a update of manjaro, the anaconda cann't work! After installing pango(python package), it can work, but there is a problem: and the plot and spyder-ide look unusually: Maybe the problem is caused by the updating of pango of m...

0
Q: How to Prevent Triplicates in Pandas DataFrame

DanI have the following code: stim_df = pd.concat([block1,block2,bloc3,block4], axis=0, ignore_index=True).sample(frac=1).reset_index(drop=True) stim_df.columns = ["Prime","Target","Condition"] #Check for triplicates: for j in xrange(len(stim_df)): if j == 0 or j == 1: pass else:...

-1
Q: Is the numerical resolution of this huge sparse polynomial system tractable?

Sebastien PalcouxI would like to solve numerically a sparse system of 2000000 polynomial equations of degree 3 with 50000 variables and integer coefficients (or at least to decide whether or not a solution exists). Question: Is there an algorithm and a supercomputer for which this resolution is tractable today?

 
3:58 AM
0
Q: How to Compare Values of two Dataframes in Pandas?

MEhsanI have two dataframes df and df2 like this id initials 0 100 J 1 200 S 2 300 Y name initials 0 John J 1 Smith S 2 Nathan N I want to compare the values in the initials columns found in (df and df2) and copy the name (in df2) which its initial is matching to the initia...

 
4:10 AM
0
Q: pandas - Using Difflib SequenceMatcher to compare columns in two different dataframes

IndiginasI would like to compare two columns in two dataframes similar to the solution provided in [SequenceMatcher ratio to merge pandas][1] [1]: Using difflib SequenceMatcher ratio to merge in Pandas The main code is as follows: for name_a, proj_a in df_list[['Name','Project']].values: # Lookup Table...

 
4:36 AM
0
Q: Can't get y-axis on Matplotlib histogram to display probabilities

JoëlI have data (pd Series) that looks like (daily stock returns, n = 555): S = perf_manual.returns S = S[~((S-S.mean()).abs()>3*S.std())] 2014-03-31 20:00:00 0.000000 2014-04-01 20:00:00 0.000000 2014-04-03 20:00:00 -0.001950 2014-04-04 20:00:00 -0.000538 2014-04-07 20:00:00 0.000764 ...

 
5:09 AM
0
Q: How do I add multiple markers to a stripplot in seaborn?

user2755526I would like to know how I could get multiple markers in the same strip plot. tips = sns.load_dataset("tips") coldict={'Sun':'red','Thur':'blue','Sat':'yellow','Fri':'green'} markdict={'Sun':'x','Thur':'o','Sat':'o','Fri':'o'} tips['color']=tips.day.apply(lambda x: coldict[x]) tips['marker']=t...

 
5:25 AM
0
Q: Splitting multiple columns into rows in pandas dataframe

ctanI have a pandas dataframe as follows: ticker account value date aa assets 100,200 20121231, 20131231 bb liabilities 50, 150 20141231, 20131231 I would like to split df['value'] and df['date'] so that the dataframe looks like this: ticker accou...

0
Q: Barnsley Fern Python script

flashliquidfrom PIL import Image import random import matplotlib.pyplot as plt A=[] mat=[[0.0,0.0,0.0,0.6,0.0,0.0,0.01], [0.85,0.04,-0.04,0.85,0.0,1.6,0.85], [0.2,-0.26,0.23,0.22,0.0,1.6,0.07], [-0.15,0.28,0.26,0.24,0.0,0.44,0.07]] x=0.0 y=0.0 for k in range(0,100000): p=random.random() ...

 
6:16 AM
0
Q: Dynamically Image to Django

utkarshI have HTML having Buttons, Sliders, Dropdown and a default graph. On Change in any of the UI, I want some calculation to be done and generate a figure using MatPlotLib and display it on browser in place of default graph. How can I do it.

 
6:30 AM
0
Q: Speeding up Evaluation of Sympy Symbolic Expressions

nymerionA Python program I am currently working on (Gaussian process classification) is bottlenecking on evaluation of Sympy symbolic matrices, and I can't figure out what I can, if anything, do to speed it up. Other parts of the program I've already ensured are typed properly (in terms of numpy arrays) ...

 
6:49 AM
@Rahul nothing hua
hahaha
@Rahul nothing hua
 
now that's the problem
 
@Rahul actually yesterday was a problem with my PC and internet
 
then solve :v
 
who cares
 
@Rahul means?
who cares for what?
 
6:52 AM
health
 
@AnshulTyagi Boss replaced you by @Rahul in W.A.
 
@AnshulTyagi Where is our Bhai
 
@PiyushGupta Don't forgot i'm your king
and you are my praza
 
@Rahul u r the king of kings
 
6:58 AM
lol your bhai is in gym
 
he is our bhai
 
ha ha bhai ):
sabka 1 bhaijan ):
 
21 messages moved from Androidians
 
7:13 AM
0
Q: Pandas - different aggregations for a field

ShgidiI have a transaction table, with the fileds: customer_id,transaction_id,month I would like to write a query which will be equivalent to the following in SQL: SELECT min(month) as first_month,max(month) as last_month from transactions group by customer_id in pandas, it seems i can only aggregat...

0
Q: Counting repeated blocks in pandas

learnerI have the following dataframe and I am trying to label an entire block with a number which is based on how many similar blocks has been seen upto now based on class column. Consecutive class value is given the same number. If the same class block comes later, the number will be incremented. If s...

 
7:30 AM
0
Q: Pivoting data in pandas

JohanSuppose I have the following data as a pandas dataframe: type exdiv paydate amount declared 2014-01-31 final 2014-03-03 2014-03-10 3.10 2014-06-27 interim 2014-08-11 2014-08-18 1.55 2015-01-30 final 2015-03-02 2015-03-...

 
7:51 AM
0
Q: How to filter a column on a key and delete the data?

Damiani need to filter a DataFrame in Pandas basing on keys. I created the DataFrame already but now i dont know how to "scan" a column for a key and delete the data. Here is my list: FAK-ART FAK-DAT LEIST-DAT KD-CRM MW-BW EQ-NR MATERIAL \ 0 ZPAF 2015-05-18 2015-05-31 ...

0
Q: Clustering with DBSCAN is surprisingly slow

eleanoraI am experimenting with clustering and I am surprised how slow it seems to be. I have produced a random graph with 30 communities each containing 30 nodes. Nodes in a communities have a 90% chance of being connected and edges between nodes not in the same community have a 10% chance of being conn...

 
8:34 AM
0
Q: pandas divide df n x m by series length g by index

bum bam bumI have a pandas dataframe of n x m and a pandas series of length g. How can I divide the dataframe by series based on the index? So far, I've been merging the series with the dataframe and the simply dividing one cell by the other. Thanks

 
in Trash, 2 hours ago, by Roshni jain
@Rahul u r the king of kings
 
0
Q: Adding automatic colorbars to matplotlib windows in backend

clockwork7I am trying to write a custom backend for matplotlib. Part of the requirement is to have a colorbar automatically shown if the plot is 2d colorfill plot. So far i have written a very hacky attempt which involves adding this code the end of FigureCanvas.draw function def draw(): # Original Co...

 
8:58 AM
1 message moved from Androidians
 
-1
Q: How to convert large list of dictionary to dataframe/matrix

xinyi FuI have a list of dictionaries which has about 5 million lines. The list looks like this: [{"a":100, "b":50},{"c":2,"a":10}] What I want is a dataframe or matrix like this: a b c 100 50 0 10 0 2 Then I will feed it into a cluster algorithm. The pd.DataFrame(...

 
9:19 AM
0
Q: Merge columns in Pandas based on date criteria

user6435943I have a dataframe like this In[337]: df Out[337]: 2013 2014 2015 2013-01-31 0.705935 0.983307 0.714397 2013-05-31 0.492020 0.532103 0.897666 2013-09-30 0.187822 0.779611 0.774774 2014-01-31 0.789511 0.383665 0.353669 2014-05-31 0.347580 0.540767 0.73286...

1
Q: Can I append to a compressed stream with pandas?

Eric HansenI know that by passing the compression='gzip' argument to pd.read_csv() I can save a DataFrame into a compressed CSV file. my_df.to_csv('my_file_name.csv', compression='gzip') I also know that if I want to append a DataFrame to the end of an existing CSV file I can use mode='a', like so my_d...

 
9:42 AM
0
Q: Sum alternate columns of a dataframe

Ronak ShahI have a dataframe which looks like A 00:00 00:30 01:00 01:30 02:00 .....22:30 23:00 23:30 1 2 3 3 4 3 1 6 4 2 5 6 2 6 5 2 1 2 I am trying to get, A 00:00 01:00 02:00 ..... 23:00 1 6 6 7 7...

 
hey guys, quick question , i call android guy for interview
which question should i ask him
@ankitagrawal @TheLittleNaruto @Rahul @berserk @brahmyadigopula
he is fresher and did 3 month job
 
don't ask any question tell him you hired
 
are you an android developer?...candidate shocks @AshuKumar rocks?...lol..just for fun bro
 
@ankitagrawal okay
 
ask him do you know berserk
if yes then
 
9:45 AM
lol
 
hire him
 
alright
 
else kick him out
 
hahaha
i m going to pay him 15k monthly
 
bro..interview time????
 
9:45 AM
please advice
yes @brahmyadigopula
 
ask him difference between arraylist.size
 
Please advice me
 
and array.length
 
wait, let me write on pad.
 
is he experienced or fresher?
 
9:46 AM
also java is pass by value or pass by reference
 
activity life cycle, shared preferences, fragments, mysql...
services, broadcast receivers....
 
@berserk he is fresher
 
oh
 
this is basic question @berserk
 
wait.. he is fresher and he did 3 months job.... wut?
 
9:47 AM
3 month job is as good as fresher
 
yes, he told me, i should considered him as fresher @berserk
 
its like I am empty stomach, ate a gulab jamun and I am still empty stomach...
@AshuKumar okay
 
good example @berserk
 
ask him OOPS concepts
 
any other question @berserk @ankitagrawal
 
9:48 AM
and java
 
alright
got it
 
What is Activity and Intent ?..ask this
 
!!ceiling
 
OK @brahmyadigopula
 
9:49 AM
@AshuKumar how are you?
 
i m good @Kaushik
 
is your bug fixed?
 
yes, ur suggestion did it
OK , guys i did not give interview so i do not know how it is :D
 
not that one
 
internet issues?
 
9:51 AM
that bug you told yesterday
 
i m working on it, and almost solved
 
which make you angry
 
OK, that i did today within 20 min :D
Oops, i was not angry @Kaushik
 
ok mad
:P
 
hahaha :D @Kaushik
 
9:53 AM
What is implicit intent in android?..brooo
 
that's all the questions @brahmyadigopula @berserk @ankitagrawal ?
 
@AshuKumar What languages do he know?
Depends on that too.
 
java, C++ @berserk
 
If he never did android, he can't answer android questions.
ask him java and oops concepts then
 
and how much should i pay him , is 15k is enough ? @berserk @ankitagrawal @brahmyadigopula
 
9:55 AM
lol idk that
 
he said he is good with android layout design
 
Are you owner of your company?
 
idk ? @berserk
 
what his demand bro...
 
@AshuKumar can I get a job sir?
 
9:55 AM
i m starting my company @Kaushik @berserk
 
how much he is expecting?
 
@AshuKumar i don't know
 
i m thinking to heir project manager as well
 
how many people are you?
Are you alone?
 
he was getting 12k before when he was doing android job @brahmyadigopula
 
9:56 AM
10K MAX
 
0
Q: Add a dynamically generated matplotlib picture in Django home

giosansI would like to add a dynamically generated picture in my home. I do not want to save the figure, but just show it directly in my home page, after some text. My views.py looks like: from django.shortcuts import render def index(request): import random import datetime import django ...

 
@ankitagrawal don't be cruel...
 
@ankitagrawal :( only
 
YEAH I AM CRUEL
 
@AshuKumar if you gonna train him in android, pay him less at beginning, kinda intership I guess
 
9:57 AM
HEHE
 
yes me alone @berserk , but my brother had web development company with 15+ people @berserk
 
10k is more
 
@AshuKumar its depend on the knowledge 10K to 15K(MAX)
 
@AshuKumar i guess 5k
 
I guess training lasts 2-3 months, and until he is on live project
 
9:57 AM
then 15k is reasonable.. bro.you should not decrease the amount which he is getting previously...@AshuKumar
 
5k @ankitagrawal :D
 
yeah 5k
 
yeahhh
job job jobb
 
but he was getting 12 k before @ankitagrawal
 
0
Q: how to add columns label on a Pandas DataFrame

Stefano FedeleI can't understand how can I add column names on a pandas dataframe, an easy example will clarify my issue: dic = {'a': [4, 1, 3, 1], 'b': [4, 2, 1, 4], 'c': [5, 7, 9, 1]} df = pd.DataFrame(dic) now if I type df than I get a b c 0 4 4 5 1 1 2 7 2 3 1 9 3 1 4 1 say now that ...

0
Q: Pandas: get percentage

ldevyataykinaI try to get percentage using df["Gender"] = np.where(df["Qsex"] == 1, "Male", "Female") df2 = pd.crosstab(df.Gender, df.Qsex, margins=True) df3 = np.round(df2[["All"]]/df['Gender'].count()*100, 2).rename(columns={"All":'%'}) sex = pd.concat([df2[["All"]],df3], axis=1) But All data doesn't ret...

 
9:58 AM
then 12.5k
 
15k is fine
 
@Kaushik i may able to give you job after 6 or 1 year later
 
@ankitagrawal sigh
 
@AshuKumar lol
 
OK @berserk or should i decrease ?
 
9:59 AM
@AshuKumar if he can work on live project right away, 15k is fine
 
12.5k max
 
i have target @ankitagrawal
 
sir if you are become manager android developers will not come to interview by seen your offering package.@ankitagrawal
 
@AshuKumar think about the project budget and plan
 
9:59 AM
not he is not able to work live project @berserk
 
@AshuKumar then put him in android training for 2-3 months with stipend of 5k
then after he is on live, pay him full salary
 
@Sanjeev cool, best point :) , yes i planned it
 
that's how it works in India I guess.... atleast that's how it was in my company
 
my company is bad than @AshuKumar own comapny...am getting that much still
 
got it @berserk
 
10:00 AM
hmmm please dnot decide by just talk see the work and plan
 
@AshuKumar please note his attitude before you hiring him..
 
@AshuKumar dont pay him :d
problem solved
 
@AshuKumar never ever ask others about this just see his work and decide
 
@Sanjeev i got project two week before @ankitagrawal knew, and i started planning from last two week
 
make him work for free
 
10:02 AM
:D @ankitagrawal
 
yeah exploit all
 
i will do work for free..hire me........lol..sir
 
hahahaah
thanks for support all , @ankitagrawal may be have some work for you in future
 
@brahmyadigopula you can help @brahmyadigopula as he is not getting proper salary
 
hahahah
 
10:03 AM
@AshuKumar if you have company i want job in that
 
sure, but i need in office work right now @Sanjeev
 
@Sanjeev thanks for your concerns bro...
 
in my company i will make people work for free
hahahahahaha
free exploit all
buahahhaahhaha
 
and you will be the only one working :P
 
0
Q: Reading text file with numpy.loadtxt

Chris ParryI am getting an error when trying to read a text file. import numpy as np fnam = 'file.txt' test_fnames = np.loadtxt(fnam, dtype='str', delimiter=' ') test_fnames KeyError: '_oh' Any help appreciated.

 
10:04 AM
@berserk you are my first employee then
 
@Rahul i do not have company right now, i m going to register it and also did not have that much budget to pay you @Rahul
 
@AshuKumar Ask him whether he can home to your place or not
 
@ankitagrawal you know my demands, right?
 
first employee registered
 
10:04 AM
yeah no salary no compensation
 
@AshuKumar Ask him whether he can come to your place or not
 
@berserk so many gls
 
i can give you that
 
hahaha
yep
 
@ankitagrawal :D
 
10:05 AM
hehe
 
@berserk LOL
lola
 
well i want beer one TV and gls and my laptop
that's it
no more demand that much only
 
@ankitagrawal @Rahul @berserk @brahmyadigopula @Sanjeev @Shubham @Kaushik
thanks to all for support
 
@AshuKumar my demand same as rahul
 
welcome sir
 
10:06 AM
what about my demand
 
its ok bro :)
 
@ankitagrawal you drink beer
 
I want food, alienware laptop, gals, 14-15 hours free, that's it :P
 
@Kaushik i m not sir, i m still studying ....
 
@AshuKumar if behavior and subject is good then hire him
 
10:07 AM
:)
 
14-15 hours free @berserk :D
 
@AshuKumar if he is she, hire her :P
 
@ankitagrawal no food ,no water too????
 
he is he @berserk
 
ah
 
10:07 AM
good point @berserk
 
 
@berserk how about if you got 14- 15 valkyrie
best of luck
 
@Kaushik nah, I don't trust them. They got an axe....
 
:)
 
i noted all question and i m gonna ask those question :)
 
10:08 AM
if i'm 14-15 hour free i will become jombie
 
lol
 
@berserk I will gladly take healer with me
 
he is fresher
 
@Kaushik nice, you can do stuff in air that way :P
 
yes @Sanjeev
 
10:09 AM
@berserk no problem with that
 
:D @berserk ^^^
 
anywhere
 
ofc it is not a problem, it sounds more fun :P
 
my ofc full of fun
 
guys, i m planing to put my app into sale :)
 
10:10 AM
but gls not interested
:(
 
I am gonna clean this up. Too much off-topic and private info.
@Rahul same ;_;
 
i support @berserk
 
1 message moved from [Tech Gossips ](chat.stackoverflow.com/rooms/59481/tech-gossips)
 
@AshuKumar you are not responding to me
 
on which topic@Sanjeev
 
10:11 AM
if only you were a girl.... :P
 
@berserk well we should go Thailand
 
@brahmyadigopula i did it
 
haha lets go
I got my passport.
 
nope you did not
 
i said thanks and noted all question that you gave me @brahmyadigopula
 
10:12 AM
Thai Massage
 
okay.....broo
 
thai cats
 
@Sanjeev to me too
 
LOL hans
 
whatt
 
10:13 AM
hehehe
 
:32004195
 
guys where is TOPIC that i started :) @berserk @Sanjeev @ankitagrawal @Rahul
 
thai catsss wowww
 
Thai Massage
 
209 messages moved from [Java and Android era ](chat.stackoverflow.com/rooms/19132/java-and-android-era)
 
10:13 AM
Interview
 
from thai cats
massage
 
sandwich massage i want
 
!!meow
 
where is thai cat
 
10:14 AM
hehe
 
i want thai cat
 
haha
 
:32004242 not cats, but its adjective... :P
 
@Hans1984 stop it yar..lol
 
uh nevermind..
i will
!!meow
 
youuuuuuuuuuuuuuuuu
 
what`?
 
moewwwwwwww
pillii
 
!!meow
 
10:15 AM
!!all
 
that was you
 
@Hans1984 Caprica gives everyone some candy
 
0
Q: Handling pandas pivot from javascript

nickpickI'm having a dataframe with around 10m rows that I need to pivot. Ideally I could do this from a web interface with flask or javascript. Is there any framework available in javascript that allows filtering and pivot tables handled server side? What I would need is a framework in javascript that a...

 
now all calm down
:3
 
!!sandwitch
 
10:15 AM
@brahmyadigopula That didn't make much sense. Maybe you meant: sandwich
 
!!massage
 
!!hehe
 
@brahmyadigopula That didn't make much sense. Maybe you meant: sausage
 
one girl up one girl down middle you sandwich massage
 
@brahmyadigopula ^
 
10:16 AM
:32004051 nope
 
you will put something on risk
 
@Rahul @berserk count me in
 
yay we got a sponsor :P
 
yeah now we should go
 
10:18 AM
hanscat
is sponsorer
yeah we are going to catland
 
...
 
go to pogoland
 
haha
 
@ankitagrawal so sir when you want me to join in your office??????
 
pogoland is for kids
@brahmyadigopula my HR will mail you the details
 
hehehehhaaaaa
mail ???
 
0
Q: Visible deprecation warning using boolean operation on numpy array

georussellI'm having an issue where I keep receiving a warning stating: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 0; dimension is 744 but corresponding boolean dimension is 1 When I try to use this: x_low = xcontacts[(xcontacts[5:6] <= 2000).any(1), :] x_med...

 
@ankitagrawal is your hr lady?is she sexy?if she is sexy then i will respond
 
@brahmyadigopula lady :D
 
10:22 AM
@ankitagrawal what?
 
@brahmyadigopula don't use NSFW words, or just delete them right away
 
OK @Kaushik,
 
lol
 
@Kaushik reply to your query do i drink
 
can't risk for flags, so need to clean up
 
10:24 AM
hmmmmmmmmmm
 
70 messages moved from [Java and Android era ](chat.stackoverflow.com/rooms/19132/java-and-android-era)
 
0
Q: python exe bt py2exe with OpenCV

Arpan GhoseI have successfully prepared an exe using py2exe. My source code contains opencv functionality. I wish to run this exe at a computer where opencv is not pre-installed. Please provide me a solution. My setup file is as follows: --------------------------------------------------------------- fro...

0
Q: How to compute percentiles from frequency table?

mefjuI have CSV file: fr id 1 10000152 1 10000212 1 10000847 1 10001018 2 10001052 2 10001246 14 10001908 ........... This is a frequency table, where id is integer variable and fr is number of occurrences given value. File is sorted ascending by value. I would like to compute percentiles (ie...

0
Q: Building MultiIndex in Pandas DataFrame

cmf05I am reading in two files into Python, both with the form: 0.00902317 0.0270695 0.0451159 0.0631622 \ 0000010 6.962980e-05 7.063750e-05 7.165970e-05 7.269680e-05 1000010 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 2000010 0.000000e+00 0.000000e+...

 
10:41 AM
what is this??
 
0
Q: Using urllib instead of wget for session authentication

Matchbox2093So currently i have a line of python code which uses wget and os.system to download a file from a website. However when i try to convert this wget to a more elegant library such as urllib or requests, the cookies fail to authenticate and instead downloads the login html page instead of the file. ...

0
Q: In Pandas, when selecting with "where", delete columns where condition is not met rather than filling with NaN

Kurt PeekIn Numpy, using where will give you a subset of the original array. For example, import numpy as np np.where(np.arange(5)>2)[0] will return array([3, 4]). I'd like to do something similar with Pandas. However, if I define a similar DataFrame like so: import pandas as pd df = pd.DataFrame(data...

0
Q: Python: create a dictionary from data in excel

ldevyataykinaI have data sign number result Qjobstatus 1 Работаю полный рабочий день Qjobstatus 2 Работаю неполный рабочий день Qjobstatus 3 Не работаю Qcountry 1 Россия Qcountry 2 Украина Qcountry 3 Беларусь Qcountry 4 Азербайджан Qcountry 5 Армения Qcountry 6 ...

0
Q: Replacing column values in Pandas

AakashI am having the same query as follows: http://datascience.stackexchange.com/q/13069/15412 The answer provided there is not helpful in any way. Please help.

 
11:08 AM
0
Q: scikits learn SVM - 1-dimensional Separating Hyperplane

flodHow to plot the separating "hyperplane" for 1-dimensional data using scikit svm ? I follow this guide for 2-dimensional data : http://scikit-learn.org/stable/auto_examples/svm/plot_svm_margin.html, but don't know how to make it works for 1-dimensional data pos = np.random.randn(20, 1) + 1 neg =...

0
Q: Scipy ValueError with griddata : Total size of new array must be unchanged

gansubI am using the code from this answer - 2d contour plot in Python I have grid data and I want to be able to make a contour plot of latitude,longitude and geopotential heights. I am using Python's scipy.interpolate to interpolate and eventually make a contour plot. grb = grbs.select(name='Geopote...

0
Q: Pandas: groupby by date and transform nunique returning to many entries

Michael PerdueI am trying to do a simple group-by in Pandas and it is not working as it should: url='https://raw.githubusercontent.com/108michael/ms_thesis/master/raw_bills' bills=pd.read_csv(url) bills.date.nunique() 11 bills.dtypes date float64 bills object id.thomas int64 dtype: obj...

 
if you create a .vbs file with this in:

Do
wait
kjdfnsdnfg\sfghfdgdf
ghdfg
4 messages moved from VBA Lounge
 
11:27 AM
0
Q: python ravel vs. transpose when used in reshape

python_freakI have a 2D array v, v.shape=(M_1,M_2), which I want to reshape into a 3D array with v.shape=(M_2,N_1,N_2), and M_1=N_1*N_2. I came up with the following lines which produce the same result: np.reshape(v.T, reshape_tuple) and np.reshape(v.ravel(order='F'), reshape_tuple) for reshape_tupl...

0
Q: Django admin - Add a custom link that runs a a function in a pop up next to a particular field?

AlexWHopefully my screen shot will demonstrate what im trying to achieve. Basically i have a function which checks all the current "DMVPN DSL IPs" in the database and then returns the lowest free IP, this part is done. However i want to be able to run that function in a pop up next to that field in th...

0
Q: Adding pandas dataframe iteratively in a memory efficient way

EscachatorI am trying to iteratively add some pandas dataframe that I read from a set of csv files, and after the 16th file or so I get a memory error. The new files are pandas of around 300k rows. Is there a way to do this in the hard drive (for example with hdf5) or in a more memory efficient way? See ...

0
Q: how to remove duplicate values in a dataset : python

lee huangI want to remove duplicate items in a dataset by keeping the ones with highest value. Now I am using pandas : c_maxes = hospProfiling.groupby(['Hospital_ID', 'District_ID'], group_keys=False)\ .apply(lambda x: x.ix[x['Hospital_employees'].idxmax()]) print c_maxes c_maxes.to_csv(...

 
12:25 PM
0
Q: Pandas: append symbol to cells in column

ldevyataykinaI create dataframe with df3 = np.round(df2[["All"]]/df['Gender'].count()*100, 2).rename(columns={"All":'%'}) and I want to add % after every number. How can I do it?

 
0
Q: Remapping `numpy.array` with missing values

BartI'm dealing with some large data sets - observations as a function of time - which are not continuous in time (i.e., there is a lot of missing data, where the complete record is absent). To make things fun, there are a lot of data sets, all with missing records, all at random places... I someho...

 
2 messages moved from Androidians
 
12:48 PM
0
Q: Numpy suddenly uses all CPUs

physicsGuyUntil recently when I used numpy methods like np.dot(A,B), only a single core was used. However, since today suddently all 8 cores of my linux machine are being used, which is a problem. A minimal working example: import numpy as np N = 100 a = np.random.rand(N,N) b = np.random.rand(N,N) for ...

0
Q: Am I properly opening and reading files into Pandas ?

RustyShacklefordI am trying to open a folder in a file path and wanting to read all the files data into dataframes, but not sure if I am doing it properly or are there much simpler ways? In the code you will see after line 32 I am calling in a access file to populate the dataframe with the column names in it, ...

 
1:00 PM
0
Q: Python Pandas: Create Groups by Range using map

escI have a large data set where I am looking to create groups based upon cumulative sum percent of the total. I have gotten this to work by using the map function see below code. Is there a better way to do this say if I wanted to make my groups even more granular? So for example now am looking ...

 
1:10 PM
0
Q: place values by condition with numpy

alec.tuI have a three channel matrix and I want to place the value which is less than 27 a=numpy.arange(27).reshape(3,3,3) a[a<27]=0 However, If I want to replace only on first channel, the way I can do is to write a for loop for i in range(3): for j in range(3): if a[i][j][0] < 27: ...

 
1:39 PM
0
Q: Keep Columns When Aggregating an Empty DataFrame

MikeI'm working in pandas 0.18.0 on python 2.7.9. Take a sample DataFrame and group by a few columns, then sum over a different column for the result, like this: >>> df = pandas.DataFrame([[1,2,3],[4,5,6],[1,2,9]], columns=['a','b','c']) >>> print df a b c 0 1 2 3 1 4 5 6 2 1 2 9 >>> ...

 
2:02 PM
0
Q: Differential step size for array

user4437416I am working in python. I have an angle quantity for which I want a varying step size for the array instead of a uniform grid that can be created like np.linspace(0, pi, 100) for 100 equal steps. Instead, I want more 'resolution' (i.e. a smaller step-size) for values close to 0 and pi, with large...

0
Q: pandas read_csv raise ValueError

StelleraI want to read txt data seperate by ',' and '\t', and I use code below: io_df = pd.read_csv('input_output.txt',sep='\D|\t',engine = 'python') This trigger error information below: --------------------------------------------------------------------------- ValueError ...

-1
Q: TensorFlow vs Scikit-learn vs Vowpal Wabbit

Василий ЛукинI have large data set in Google Cloud Storage (csv; around 300 GB; CRM data on customers) and I should create model which will predict comeback of our customers on our site. I have several alternatives: Processing and data cleansing Read data by chunks in pandas; clean data and create features...

 
2:34 PM
0
Q: Best way to store scraped data in Python for analysis

MichaelI am scraping data of football player statistics from the web using python and Beautiful Soup. I will be scraping from multiple sources, and each source will have a variety of variables about each player which include strings, integers, and booleans. For example player name, position drafted, pro...

-2
Q: Unknown * in numpy.random function

aceminerI was studying this link and this is the code . U1 = np.random.rand(*H1.shape) < p # first dropout mask Why does it fail when I try to do this? import numpy numpy.random.rand(*1) < 2 I understand that the rand() function takes in a number which is why I am confused that the code is suppos...

1
Q: Succinct way to access a single value from a Pandas DataFrame by index

Kurt PeekSuppose I have a DataFrame generated like so: import numpy as np import pandas as pd np.random.seed(seed=0) df = pd.DataFrame(index=list('AB'), columns=list('CD'), data=np.random.randn(2,2)) which looks like C D A 1.764052 0.400157 B 0.978738 2.240893 and suppose I'd ...

0
Q: How to open folder and place text files in dataframe and rename dataframe based on file name?

RustyShacklefordI am trying to open a folder which has multiple text files and put each file in its own dataframe and name each dataframe by the filename. My code so far is recognizing the 5 files in the folder but is not putting the data in the files into dataframes based on their file names. could someone sh...

0
Q: Python: read_csv large text file with missing data, define column types, and apply statistics

Provisional.ModulationI'd like to open a text file that contains missing data, categorical and continuous variables, and store the information onto a data frame; then apply statistical models. However, my hurdle is understanding how to elegantly accomplish this task. I will first present the data and sample code, then...

 
3:04 PM
in Tavern on the Meta on Meta Stack Exchange Chat, 14 mins ago, by Quill
And that seems like the perfect place to troll, right? What better place to rub salt than in a wound
 
@ndugger Great, you replaced a message that took up too much space with a message that takes up too much space. Good work.
 
0
Q: Pandas - equivalent of str.contains() in pandas query

raulCreating a dataframe using subsetting with below conditions subset_df = df_eq.loc[(df_eq['place'].str.contains('Chile')) & (df_eq['mag'] > 7.5),['time','latitude','longitude','mag','place']] Want to replicate the above subset using query() in Pandas.However not sure how to replicate str.contai...

 
@BenjaminGruenbaum "he was bragging about trolling" → "he was bragging about kicking"
 
0
Q: How to perform pandas drop_duplicates based on index column

AndreuccioI am banging my head against the wall when trying to perform a drop duplicate for time series, base on the value of a datetime index. My function is the following: def csv_import_merge_T(f): dfsT = [pd.read_csv(fp, index_col=[0], parse_dates=[0], dayfirst=True, names=['datetime','temp','rh...

 
3:32 PM
0
Q: How to speed this up: Searching through multiple lists of dates to find closest match. [Python, Pandas]

user5503831I have one list of dates, master_time. For each date in master_time, I am searching for the closest match in four other lists of dates; time1,time2,time3, and time4. The results are appended to "closestmatch" lists which will later be used to join dataframes containing timeseries information from...

0
Q: I can't install pycharm due to Sub-process /usr/bin/dpkg returned an error code (1)

AlphaBetaGamma96I've recently install anaconda and I'm using PyCharm as my IDE, but when I go to import some modules, they don't seem to exist, even though they were downloaded with anaconda. When I tried to download Matplotlib via the terminal I get this Errors were encountered while processing: python-six ...

0
Q: matplotlib and subplots properties

vandelayI'm adding a matplotlib figure to a canvas so that I may integrate it with pyqt in my application. I were looking around and using plt.add_subplot(111) seem to be the way to go(?) But I cannot add any properties to the subplot as I may figure setup self.figure1 = plt.figure() self.canvas1 = Fi...

-3
Q: Need help with python set up

Antonio Jesus Roldan What am I supposed to do about this? It's been more than two days already and I still have no idea how to set up python in an atom environment nor in sublime text. I just want to run my scripts freely without getting pissed off whenever I type on the keyboard. Pls, I really need your help. It s...

0
Q: Singly Linked List implementation in Python

CodeMonkeyI'm new to Python and thus learning it by implementing a set of commonly used data structures. Here's my implementation of a LinkedList. First the Node class. class Node: def __init__(self, value = None, next = None): self.value = value; self.next = next; Here's the Linke...

0
Q: discretizing an array and mapping to single number

ThiagarajanI have A 1D numpy observation array example [a,b,c,d]. a,b,c,d takes continous values, with each of them belonging to different finite domain.Example a lies from -2. to 2. etc. My goal is to map any such observation to a single number. Example [1,2,-3,4] and [1,2,-2.7,4] gets mapped to same num...

0
Q: Resample within a typical week

Philipp_KatsI need to aggregate large dataset to 15-min backets, then average bucket in order to have a typical week timeseries. For now I do it like that: def _avWeek(df, tcol='ts', ccol='id', label=None): s = df[[tcol, ccol]].rename(columns={tcol: 'ts', ccol...

0
Q: Sort pandas DataFrame with function over column values

OhumeronenBased on python, sort descending dataframe with pandas: Given: from pandas import DataFrame import pandas as pd d = {'one':[2,3,1,4,5], 'two':[5,4,3,2,1], 'letter':['a','a','b','b','c']} df = DataFrame(d) df then looks like this: df: letter one two 0 a 2 5 ...

0
Q: Create array with elements inserted without using np.insert

Aditya369I have two arrays, say, n = [1,2,3,4,5,6,7,8,9] nc = [3,0,2,0,1,2,0,0,0] The nonzero elements in nc are ncz = [3,2,1,2]. The elements in n corresponding to non zero elements in nc are p = [1,3,5,6]. I need to create a new array with elements of p[1:] inserted after (ncz+1)[:-1] i.e after [4,6,...

 
00:00 - 16:0016:00 - 00:00

« first day (888 days earlier)      last day (1300 days later) »