<jupyter_start><jupyter_text>pandas - wprowadzeniehttps://pandas.pydata.org/docs/getting_started/10min.html<jupyter_code>import numpy as np
import pandas as pd
pd.__version__
s1 = pd.Series([1, 2, 3, 4, 5])
s1
s2 = pd.Series(["Ania", "Kamil", "Kasia", "Stefan", "Ola"])
s2
s2[1]
s2[0:3]
arr_1 = np.linspace(1, 10, num=10).astype(np.int8)
arr_2 = np.random.random(10)
arr_3 = [chr(x + ord('A')) for x in range(0, 10)]
data = {
    'lin': arr_1,
    'rand': arr_2,
    'letters': arr_3,
}
df1 = pd.DataFrame(data)
df1
df1.dtypes
df1[1:4]
df1['letters']
df1.head(3)
df1.sort_values(by='rand')
df1[df1['rand'] > 0.9]
filtered = df1[df1['rand'] > 0.9]
items = [df1[0:8], filtered]
df2 = pd.concat(items)
df2
df2.drop_duplicates()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20159151193633953, 'fraction_numerical': 0.07559681697612732, 'mean_word_length': 5.291666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '362785', 'license': 'MIT', 'n_tokens_mistral': 379, 'n_tokens_neox': 361, 'n_words': 67, 'path': 'pandas-wprowadzenie.ipynb', 'repo_name': 'MrUPGrade/hack4change-workshop', 'size': '754'}