Just a function to convert everything in Pandas DataFrames / Series to string
Project description
Installation
pip install a-pandas-ex-df-to-string
Usage
from a_pandas_ex_df_to_string import pd_add_to_string
pd_add_to_string()
import pandas as pd
from random import choice
csvtests = [
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_long.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_no2.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_no2_long.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_parameters.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_pm25_long.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/air_quality_stations.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/baseball.csv",
"https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv",
]
csvfile = choice(csvtests)
df = pd.read_csv(csvfile)
print(df)
print(df.dtypes)
df2=df.ds_to_string()
print(df2)
print(df2.dtypes)
id description name
0 bc Black Carbon BC
1 co Carbon Monoxide CO
2 no2 Nitrogen Dioxide NO2
3 o3 Ozone O3
4 pm10 Particulate matter less than 10 micrometers in... PM10
5 pm25 Particulate matter less than 2.5 micrometers i... PM2.5
6 so2 Sulfur Dioxide SO2
id object
description object
name object
dtype: object
id description name
0 bc Black Carbon BC
1 co Carbon Monoxide CO
2 no2 Nitrogen Dioxide NO2
3 o3 Ozone O3
4 pm10 Particulate matter less than 10 micrometers in... PM10
5 pm25 Particulate matter less than 2.5 micrometers i... PM2.5
6 so2 Sulfur Dioxide SO2
id string
description string
name string
dtype: object
Project details
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 a_pandas_ex_df_to_string-0.14.tar.gz
.
File metadata
- Download URL: a_pandas_ex_df_to_string-0.14.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 479ca528de47c650aeeb33903c94e0755c88cf1cb95e8b5531972b690caad677 |
|
MD5 | bef1dfbcdecc0214446eed70f6b7732d |
|
BLAKE2b-256 | 8857e14e7424ef0c597646f999006a3843361cac1aa859b8f1f86b71ef2f8c53 |
File details
Details for the file a_pandas_ex_df_to_string-0.14-py3-none-any.whl
.
File metadata
- Download URL: a_pandas_ex_df_to_string-0.14-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d3da187293e30a345967458420d259810b7fa17b06f294e586a6b5b108ed2f7 |
|
MD5 | 5ced908c3989ac1b3314011c1a56c23d |
|
BLAKE2b-256 | 5fc9d6b86f15cfa4cb9c910f62968c3fc9958517ede786b0a99377d2741d3585 |