Create an independent copy of any object, function etc.
Project description
Create an independent copy of any object, function etc.
pip install copy-functions-and-more
from copy_functions_and_more import copy_func
import pandas as pd
df = pd.read_csv( "https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")
copieddescribe = copy_func(df.describe)
print(copieddescribe())
copy_func(df.__str__)
strco=copy_func(df.__str__)
print(strco())
print(copieddescribe is df.describe)
print(copieddescribe == df.describe)
print(strco is df.__str__)
print(strco == df.__str__)
PassengerId Survived Pclass ... SibSp Parch Fare
count 891.000000 891.000000 891.000000 ... 891.000000 891.000000 891.000000
mean 446.000000 0.383838 2.308642 ... 0.523008 0.381594 32.204208
std 257.353842 0.486592 0.836071 ... 1.102743 0.806057 49.693429
min 1.000000 0.000000 1.000000 ... 0.000000 0.000000 0.000000
25% 223.500000 0.000000 2.000000 ... 0.000000 0.000000 7.910400
50% 446.000000 0.000000 3.000000 ... 0.000000 0.000000 14.454200
75% 668.500000 1.000000 3.000000 ... 1.000000 0.000000 31.000000
max 891.000000 1.000000 3.000000 ... 8.000000 6.000000 512.329200
[8 rows x 7 columns]
PassengerId Survived Pclass ... Fare Cabin Embarked
0 1 0 3 ... 7.2500 NaN S
1 2 1 1 ... 71.2833 C85 C
2 3 1 3 ... 7.9250 NaN S
3 4 1 1 ... 53.1000 C123 S
4 5 0 3 ... 8.0500 NaN S
.. ... ... ... ... ... ... ...
886 887 0 2 ... 13.0000 NaN S
887 888 1 1 ... 30.0000 B42 S
888 889 0 3 ... 23.4500 NaN S
889 890 1 1 ... 30.0000 C148 C
890 891 0 3 ... 7.7500 NaN Q
[891 rows x 12 columns]
False
False
False
False
newlist=[33354,442,4535,333]
newlist2=copy_func(newlist)
print(newlist2 is newlist)
print(newlist2 == newlist)
False
True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file copy_functions_and_more-0.10.tar.gz
.
File metadata
- Download URL: copy_functions_and_more-0.10.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90cf2bf20cdd23e933e40cc0a363482ab2fd7aab825cb821d0731a97b8d72aaf |
|
MD5 | e1865069806d2ef7773170f32198e667 |
|
BLAKE2b-256 | ec02d8780bd8789b9bc2d4e46f767245fa1ecd8429faae433ed353bc858b5fec |
File details
Details for the file copy_functions_and_more-0.10-py3-none-any.whl
.
File metadata
- Download URL: copy_functions_and_more-0.10-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb435771616b3bcd5eae6b286a12879dc8c980cae9dd5655ba99af5b8bbb4f09 |
|
MD5 | 10fd4d56284214054f6502afd9e16e58 |
|
BLAKE2b-256 | 2fd7126657593f6a723ce6fea8ea4c6959d56c428a484db7826b43184374f2c5 |