Re: Py_IS_TYPE(op, &PyDict_Type) does not work on MacOS

2021-11-08 Thread Barry


> On 8 Nov 2021, at 07:45, Marco Sulla  wrote:
> 
> As you can read here:
> 
> https://github.com/Marco-Sulla/python-frozendict/issues/37
> 
> Py_IS_TYPE(op, &PyDict_Type) did not work on MacOS. I had to use PyDict_Check.
> 
> Why don't I have this problem with Linux?
> 
> PS: since I'm creating a modified version of dict, I copied the dict
> internal source and I link against them. Maybe the problem is
> correlated.

You can see what I did for PyCXX at 
https://sourceforge.net/p/cxx/code/HEAD/tree/trunk/CXX/Src/IndirectPythonInterface.cxx

See the _DictCheck and ends up using PyObject_IsInstance.

My guess is that use PyDict_Check is a good and better for the future.

Barry

> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Problem with concatenating two dataframes

2021-11-08 Thread Schachner, Joseph
The problem I see here is use of Pandas.   I know I have he losing opinion, but 
people who use Python to load Panadas and then only use Pandas are missing out 
on the functionality of Python.

I'll bet you could code combining this data in pure Python, into one 
dictionary. In fact I'd be shocked if you couldn't do it.

 Joseph S.


Teledyne Confidential; Commercially Sensitive Business Data

-Original Message-
From: Mahmood Naderan  
Sent: Saturday, November 6, 2021 6:01 PM
To: [email protected]; MRAB 
Subject: Re: Problem with concatenating two dataframes

>The second argument of pd.concat is 'axis', which defaults to 0. Try 
>using 1 instead of 0.


Unfortunately, that doesn't help...


dict[name] = pd.concat( [dict[name],values], axis=1 )



{'dummy': Value
M1  0
M2  0
M3  0, 'K1':Value  Value
0   10.0NaN
15.0NaN
2   10.0NaN
6NaN2.0
7NaN2.0
8NaN2.0, 'K2':Value
3 20
4 10
5 15}



Regards,
Mahmood



-- 
https://mail.python.org/mailman/listinfo/python-list