A1001. 01序列

问题描述
  对于长度为6位的一个01串,每一位都可能是0或1,一共有64种可能。它的前几个是:
  000000
  000001
  000010
  000011
  000100
  请按从小到大的顺序输出这64种01串。
输出格式
  输出64行,每行一个01串。



源代码
  1. #include<iostream>
  2. #include<bitset>
  3. using namespace std;
  4. int main()
  5. {
  6.     int i;
  7.     for (i = 0; i < 64;i++)
  8.     cout << bitset<6>(i)<<endl;
  9.     return 0;
  10. }
暂时理解为,<bitset><二进制数的个数>(十进制变量)

    生成行为序列特征... 预处理失败: Length mismatch: Expected axis has 1 elements, new values have 6 elements C:\Users\Lenovo\AppData\Local\Temp\ipykernel_20948\3356220079.py:91: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method. The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy. For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. user_df['user_geohash'].fillna('unknown', inplace=True) C:\Users\Lenovo\AppData\Local\Temp\ipykernel_20948\3356220079.py:91: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy user_df['user_geohash'].fillna('unknown', inplace=True) Traceback (most recent call last): File "C:\Users\Lenovo\AppData\Local\Temp\ipykernel_20948\3356220079.py", line 215, in preprocess_data user_df = generate_behavior_features(user_df) File "C:\Users\Lenovo\AppData\Local\Temp\ipykernel_20948\3356220079.py", line 147, in generate_behavior_features user_item_stats.columns = ['user_id', 'item_id', 'pv', 'cart', 'fav', 'buy'] ^^^^^^^^^^^^^^^^^^^^^^^ File "E:\python\Lib\site-packages\pandas\core\generic.py", line 6335, in __setattr__ return object.__setattr__(self, name, value) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "pandas/_libs/properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__ File "E:\python\Lib\site-packages\pandas\core\generic.py", line 817, in _set_axis self._mgr.set_axis(axis, labels) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "E:\python\Lib\site-packages\pandas\core\internals\managers.py", line 238, in set_axis self._validate_set_axis(axis, new_labels) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ File "E:\python\Lib\site-packages\pandas\core\internals\base.py", line 98, in _validate_set_axis raise ValueError( ...<2 lines>... ) ValueError: Length mismatch: Expected axis has 1 elements, new values have 6 elements
    最新发布
    11-08
    评论
    成就一亿技术人!
    拼手气红包6.0元
    还能输入1000个字符
     
    红包 添加红包
    表情包 插入表情
     条评论被折叠 查看
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值